Skip to content

Midlige_McCownSubmission#7

Open
amidlige wants to merge 9 commits into
lyy005:masterfrom
amidlige:master
Open

Midlige_McCownSubmission#7
amidlige wants to merge 9 commits into
lyy005:masterfrom
amidlige:master

Conversation

@amidlige

Copy link
Copy Markdown

No description provided.

Comment thread part1.py
str = gender + ' ' + exp + '\n'
with open('new.txt', 'a') as n:
n.write(str)

@lyy005 lyy005 Oct 5, 2017

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.

Missing the unique and sorting part of the question.

data=pandas.read_csv("wages.csv")
genderYears=data.iloc[:,0:2]
unique_genderYears=genderYears.drop_duplicates()
sorted=unique_genderYears.sort_values(by=['gender', 'yearsExperience'])
sorted.to_csv('sortedUniqueWagesPython.txt',header=False,index=False,sep=' ')

-0.5

Comment thread Exercise5b.py
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)

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

Comment thread Exercise5c.py
ed16=wages[wages.yearsSchool==16] #16 years of education
minimum16=min(ed16.wage) #minimum wage of 16
print (minimum16-minimum12)

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants