-
Notifications
You must be signed in to change notification settings - Fork 11
Midlige_McCownSubmission #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
4fd3615
df86790
dc3af25
9628dc4
f61d262
decca50
1360366
66bad36
8beb584
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| import pandas | ||
| wages=pandas.read_csv("wages.csv") | ||
| wages.drop([col for col in wages.columns if 'yearsSchool' in col],axis=1,inplace=True) | ||
| cc=(wages.sort_values(by='wage')) | ||
| print ("Lowest Earner") | ||
| print (cc.head(n=1)) | ||
| print ("Highest Earner") | ||
| print (cc.tail(n=1)) | ||
| print ("Top 10 Female Earners") | ||
| numoffemales=wages[wages['wage']>=wages['wage'].nlargest(10).iloc[-1]]['gender'].eq('female').sum() | ||
| print (numoffemales) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| import pandas | ||
| wages=pandas.read_csv("wages.csv") | ||
| ed12=wages[wages.yearsSchool==12] #12 years of education | ||
| minimum12=min(ed12.wage) #minimum wage of 12 | ||
| ed16=wages[wages.yearsSchool==16] #16 years of education | ||
| minimum16=min(ed16.wage) #minimum wage of 16 | ||
| print (minimum16-minimum12) | ||
|
|
||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good job |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| import os | ||
|
|
||
| with open('wages.csv','r') as f: | ||
| file = f.readlines() | ||
|
|
||
|
|
||
|
|
||
|
|
||
| for line in file: | ||
| line = line.split(',') | ||
| gender = line[0] | ||
| exp = line[1] | ||
| str = gender + ' ' + exp + '\n' | ||
| with open('new.txt', 'a') as n: | ||
| n.write(str) | ||
|
|
||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing the unique and sorting part of the question. data=pandas.read_csv("wages.csv") -0.5 |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job