import warnings
warnings.filterwarnings('ignore')
from IPython.display import display, clear_output
from __future__ import print_function
from ipywidgets import interact, interactive, fixed, interact_manual, Layout
import ipywidgets as widgets
from IPython.display import display
import matplotlib.pyplot as plt
%matplotlib inline
import pandas as pd
from numpy import median
from openpyxl import Workbook
import plotly
import numpy as np
import statistics
import plotly.express as px
%matplotlib widget
import plotly.graph_objects as go
import plotly.io as pio
pio.renderers.default='notebook'
Data = pd.read_csv('/Users/codywang/Library/Containers/com.microsoft.Excel/Data/Downloads/Classof2022CareerOutcomes1.csv')
Data.head()
| Program | Graduation Year | Undergraduate Major | Active | Include in Reporting | Industry | With what company will you be employed after graduation? | Job Title | US State / Canada Province | City | Base Salary | Base Salary Pay Period | Estimated Total Compensation | Estimated Total Compensation Pay Period | Reported Date | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | Undergrad Business | 2022 | Accounting | Yes | Yes | Financial Services | Deloitte | Audit Associate | Georgia | Atlanta - GA | $60,000.00 | per year | $60,000.00 | per year | 05/19/2022 |
| 1 | Undergrad Business | 2022 | Finance | Yes | Yes | Consulting | Deloitte | Analyst | Massachusetts | Boston - MA | $80,000.00 | per year | $80,000.00 | per year | 06/28/2022 |
| 2 | Undergrad Business | 2022 | Financial Management | Yes | Yes | NaN | Vandley Industries | NaN | NaN | NaN | NaN | NaN | NaN | NaN | 04/25/2022 |
| 3 | Undergrad Business | 2022 | Financial Management | Yes | Yes | NaN | Key Bank | Banking Teller | Connecticut | West Hartford - CT | $42,850.00 | per year | $42,850.00 | per year | 06/13/2022 |
| 4 | Undergrad Business | 2022 | Digital Marketing and Analytics | Yes | Yes | Consulting | AlphaSights | Client Service Associate | New York | New York - NY | $70,000.00 | per year | $70,000.00 | per year | 04/22/2022 |
major = Data['Undergraduate Major'].value_counts()
major.to_excel('Majors_ALL.xlsx',
sheet_name='1')
df1 = pd.read_excel('Majors_ALL.xlsx')
df1.columns = ['Majors', 'Number of People']
values1 = df1['Number of People']
names1 = df1['Majors']
fig1 = px.pie(df1,
values=values1,
names=names1,
title="Students' major distribution"
)
fig1.update_traces(
textposition='outside',
textinfo='percent+label'
)
fig1.update_layout(showlegend=False)
fig1.show()
plotly.offline.plot(fig1,filename='majors.html',config={'displayModeBar': False})
'majors.html'
where = Data['With what company will you be employed after graduation?'].value_counts()[:15].sort_values(ascending=False)
where.to_excel('Companies_ALL.xlsx',
sheet_name='1') # after companies use _ to distinguish each department. eg. companies_BUSN
df2 = pd.read_excel('Companies_ALL.xlsx')
df2.columns = ['companies', 'numbers']
values2 = df2['numbers']
names2 = df2['companies']
fig2 = px.pie(df2,
values=values2,
names=names2,
title='Companies that hired our students'
)
fig2.update_traces(
textposition='outside',
textinfo='percent+label'
)
fig2.show()
plotly.offline.plot(fig2,filename='companies.html',config={'displayModeBar': False})
'companies.html'
industry = Data['Industry'].value_counts()
industry.to_excel('Industry_ALL.xlsx', sheet_name='1')
df3 = pd.read_excel('Industry_ALL.xlsx')
df3.columns = ['Industries', 'numbers']
values3 = df3['numbers']
names3 = df3['Industries']
fig3 = px.pie(df3,
values=values3,
names=names3,
title='Industries that students work for'
)
fig3.update_traces(
textposition='outside',
textinfo='percent+label'
)
fig3.show()
plotly.offline.plot(fig3,filename='industry.html',config={'displayModeBar': False})
'industry.html'