Skip to content

Commit

Permalink
app21-final-updates
Browse files Browse the repository at this point in the history
  • Loading branch information
silvermete0r committed Dec 21, 2023
1 parent 46c5c9c commit b99907d
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 8 deletions.
5 changes: 4 additions & 1 deletion .streamlit/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,7 @@ primaryColor="#4F7D7B"
backgroundColor="#2B2934"
secondaryBackgroundColor="#1C1B21"
textColor="#ffffff"
font="sans serif"
font="sans serif"

[deprecation]
showPyplotGlobalUse = false
Empty file added .streamlit/secrets.toml
Empty file.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@
| [Day_#17](https://github.com/silvermete0r/31github/blob/master/projects/day17.py) | 📝 Named Entity Recognition (NER) using BERT model from HuggingFace | This app helps to identify the entities in a given text. The `bert-base-NER` model used from HuggingFace. | HuggingFace Transformers |
| [Day_#18](https://github.com/silvermete0r/31github/blob/master/projects/day18.py) | 📝 Text English to French Language Translation App | This app uses the `Helsinki-NLP/opus-mt-en-fr` model to translate English text to French. | HuggingFace Transformers |
| [Day_#19](https://github.com/silvermete0r/31github/blob/master/projects/day19.py) | 📷 Instagram Analytics Web App | This app uses the `instaloader` library to download Instagram profile data. | Instaloader |
| [Day_#20](https://github.com/silvermete0r/31github/blob/master/projects/day20.py) | ₿ Cryptocurrency Analytics Web App | This app is cryptocurrency analytics dashboard that allows you to analyze price, volume, and volatility of different cryptocurrencies. | Cryptocompare API |
| [Day_#21](https://github.com/silvermete0r/31github/blob/master/projects/day21.py) | | | |
| [Day_#20](https://github.com/silvermete0r/31github/blob/master/projects/day20.py) | 🥮 Cryptocurrency Analytics Web App | This app is cryptocurrency analytics dashboard that allows you to analyze price, volume, and volatility of different cryptocurrencies. | Cryptocompare API |
| [Day_#21](https://github.com/silvermete0r/31github/blob/master/projects/day21.py) | 💰 Data Scientists Salary Analysis | This app shows how to use Streamlit to create charts and plots for data visualization on the example of Data Scientists Salary Analysis. | Streamlit Docs |
| [Day_#22](https://github.com/silvermete0r/31github/blob/master/projects/day22.py) | | | |


<!-- LICENSE -->
Expand Down
11 changes: 7 additions & 4 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@ def main():
'Day_#17': '📝 Named Entity Recognition (NER) using BERT model from HuggingFace',
'Day_#18': '📝 Text English to French Language Translation App',
'Day_#19': '📷 Instagram Analytics Web App',
'Day_#20': '₿ Cryptocurrency Analytics Web App',
'Day_#21': '',
'Day_#20': '🥮 Cryptocurrency Analytics Web App',
'Day_#21': '💰 Data Scientists Salary Analysis',
'Day_#22': '',
},
'Description': {
'Day_#1': 'This app analyze data about NBA Basketball Player Stats in Regular Seasons! Data taken from official resource using web scrapping!',
Expand All @@ -73,7 +74,8 @@ def main():
'Day_#18': 'This app uses the `Helsinki-NLP/opus-mt-en-fr` model to translate English text to French.',
'Day_#19': 'This app uses the `instaloader` library to download Instagram profile data.',
'Day_#20': 'This app is cryptocurrency analytics dashboard that allows you to analyze price, volume, and volatility of different cryptocurrencies.',
'Day_#21': '',
'Day_#21': 'This app shows how to use Streamlit to create charts and plots for data visualization on the example of Data Scientists Salary Analysis.',
'Day_#22': '',
},
'Reference': {
'Day_#1': 'Data Professor',
Expand All @@ -96,7 +98,8 @@ def main():
'Day_#18': 'HuggingFace Transformers',
'Day_#19': 'Instaloader',
'Day_#20': 'Cryptocompare API',
'Day_#21': '',
'Day_#21': 'Streamlit Docs',
'Day_#22': '',
},
})

Expand Down
62 changes: 61 additions & 1 deletion projects/day21.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import streamlit as st
import pandas as pd
from sklearn.preprocessing import LabelEncoder
import matplotlib.pyplot as plt
import seaborn as sns
sns.set_theme(style="whitegrid", palette="rocket")

@st.cache_data()
def load_data():
Expand All @@ -20,4 +24,60 @@ def app():

data = load_data()

st.markdown('### Line Chart')
st.markdown('### Data Overview')
st.info(f'Number of rows: {data.shape[0]} and Number of columns: {data.shape[1]}')
st.caption('Columns:')
st.json(data.columns.to_list())
st.caption('Data:')
st.dataframe(data.style.highlight_max(axis=0, color='green').highlight_min(axis=0, color='purple'))
st.caption('Data Types:')
st.json(data.dtypes.to_dict())
st.caption('Numeric Data Description:')
st.dataframe(data.describe().T.style.highlight_max(axis=0, color='green').highlight_min(axis=0, color='purple'))

st.markdown('### Data Visualization')

st.markdown('#### Salary Distribution')
plt.figure(figsize=(12, 6), dpi=300)
sns.histplot(data['salary_in_usd'], kde=True, bins=30)
plt.xlabel('Salary in USD')
st.pyplot()

st.markdown('#### Distribution of experience levels')
st.bar_chart(data['experience_level'].value_counts())

st.markdown('#### Distribution of employment types')
st.bar_chart(data['employment_type'].value_counts())

st.markdown('#### Top 10 Job Titles')
st.bar_chart(data['job_title'].value_counts().head(10))

st.markdown('#### Top 10 Locations for Data Scientists')
st.bar_chart(data['company_location'].value_counts().head(10))

st.markdown('#### Salary vs Experience Level')
plt.figure(figsize=(12, 6), dpi=300)
sns.boxplot(x='experience_level', y='salary_in_usd', data=data, order=data['experience_level'].value_counts().index)
plt.xlabel('Experience Level')
plt.ylabel('Salary in USD')
st.pyplot()

st.markdown('#### Salary vs Employment Type')
plt.figure(figsize=(12, 6), dpi=300)
sns.boxplot(x='employment_type', y='salary_in_usd', data=data, order=data['employment_type'].value_counts().index)
plt.xlabel('Employment Type')
plt.ylabel('Salary in USD')
st.pyplot()

def data_prepare(data):
le = LabelEncoder()
for col in ['experience_level', 'employment_type', 'salary_currency', 'job_title', 'employee_residence', 'company_location', 'company_size']:
data[col] = le.fit_transform(data[col])
return data

st.markdown('#### Correlation Matrix')
with st.spinner('Preparing data...'):
data = data_prepare(data)
plt.figure(figsize=(12, 6), dpi=300)
sns.heatmap(data.corr(), annot=True, cmap='rocket', fmt='.2f')
st.pyplot()

0 comments on commit b99907d

Please sign in to comment.