Skip to content

Pandas lab Marco - #11

Open
marcoayora wants to merge 1 commit into
Ironhack-data-bcn-oct-2023:mainfrom
Ironhack-DA:main
Open

marcoayora wants to merge 1 commit into
Ironhack-data-bcn-oct-2023:mainfrom
Ironhack-DA:main

Conversation

@marcoayora

Copy link
Copy Markdown

No description provided.

@sh-ih

sh-ih commented Oct 23, 2023

Copy link
Copy Markdown

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