Skip to content

chambers-yamasaki submission#5

Open
ayamasaki2011 wants to merge 12 commits into
lyy005:masterfrom
ayamasaki2011:master
Open

chambers-yamasaki submission#5
ayamasaki2011 wants to merge 12 commits into
lyy005:masterfrom
ayamasaki2011:master

Conversation

@ayamasaki2011

Copy link
Copy Markdown

No description provided.

Comment thread Exercise5_AEY_JC.py
#Question 1 Part 2
wages = pandas.read_csv("wages.csv")
gender_Experience=wages[["gender","yearsExperience"]]
ordered_gender_Experience=gender_Experience.sort(['gender','yearsExperience'], ascending=[True,True])

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.

"gender_Experience.sort" should be "gender_Experience.sort_values"

Comment thread Exercise5_AEY_JC.py
# Question 2 part 1
import pandas
ex5data=pandas.read_csv("wages.csv")
sorted1=ex5data.drop('yearsSchool', axis=1, inplace=True)

@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.

What is the variable "sorted1" for?

Comment thread Exercise5_AEY_JC.py
finded = line.find('female')
if finded != -1 and finded != 0:
total += 1
print("Number of women in the top 10 earners", total)

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.

Or you can just use:
femalesInTopTen=sum(top10.gender=="female")

Comment thread Exercise5_AEY_JC.py
import pandas
ex5data=pandas.read_csv("wages.csv")
sorted1=ex5data.sort_values("wage")
duplicates=sorted2.drop_duplicates("wage")

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.

Don't need to drop_duplicates for this question

Comment thread Exercise5_AEY_JC.py
wages_highschool = wages[wages.yearsSchool == 12]
wages_college = wages[wages.yearsSchool == 16]
ordered_wages_HS = wages_highschool.sort(columns='wage', ascending=True)
ordered_wages_C = wages_college.sort(columns='wage', ascending=True)

@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.

wages_college.sort -> wages_college.sort_values

-0.25

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