Skip to content

Pandas lab Marco #11

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

marcoayora
Copy link

No description provided.

@sh-ih
Copy link

sh-ih commented Oct 23, 2023

You’ll dream of pandas at the end of this bootcamp! Congrats on a very good lab

Some comments:
On question 6. Create a subset of this data frame that contains only the Score 1, 3, and 5 columns, the instruction was referring to the name of the columns, not the index, so the code should be:
subset_df = df[['Score_1','Score_3', 'Score_5']]

On question 12 you got the most and least expensive products, but you didn’t print the difference

On the exercises with the admissions dataframe, on question 2, you did the set_index, but since you didn’t use inplace=True as parameter, you can see that in the next question, your index is not Serial No. anymore.

On question 3 we had two conditions to meet: “number of rows where the CGPA is greater than 9 and the student has performed an investigation.” So you needed to run both conditions at the same time:

rslt = admissions[(admissions['CGPA'] > 9) & (admissions['Research'] > 0)]
rslt

And the same on question 4: “all the rows where the CGPA is greater than 9 and the SOP score is less than 3.5”:

rslt_4 =  admissions[(admissions["CGPA"]> 9) & (admissions["SOP"] < 3.5)]
rslt_4

And then calculate the mean of the Chance to admit column
mean_chance = rslt_4[‘Chance of Admit’].mean()

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