Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions EX_5_Script
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import numpy
import os
os.listdir('.')
os.chdir('/Users/sampathkumarbalaji/EX_5/Intro_Biocom_ND_319_Tutorial5')
import pandas
wages_csv=pandas.read_csv("wages.csv")
col_unq_sort_gen_yrs = (wages_csv.iloc[:,0:2]).drop_duplicates(keep='first').sort_values(by='gender', ascending=True).sort_values(by= 'yearsExperience', ascending=True)
col_unq_sort_gen_yrs.to_csv('ex5.csv', sep=' ', index=False)

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job

print ('Highest earner:')
earner_H = wages_csv.sort_values(by='wage', ascending=False).iloc[0:1, [0,1,3]]
print (earner_H.to_string(index=False))
print ('Lowest earner:')
earner_L = wages_csv.sort_values(by='wage', ascending=True).iloc[0:1, [0,1,3]]
print (earner_L.to_string(index=False))
print ('Women in Top 10 Earners:')
earner_top10_w = wages_csv.sort_values(by='wage', ascending=False).iloc[0:11, [0,1,3]]
earner_number_of_women = (earner_top10_w[earner_top10_w.gender=="female"]).shape[0]
print (earner_number_of_women)

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job

print('Effect - Graduating College on Minimum Wage:')
min_wages_12 = (wages_csv[wages_csv.yearsSchool==12]).sort_values(by='wage', ascending=True).iloc[0:1, 3]
min_wages_16 = (wages_csv[wages_csv.yearsSchool==16]).sort_values(by='wage', ascending=True).iloc[0:1, 3]
print (min_wages_16.values - min_wages_12.values)

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job