-
Notifications
You must be signed in to change notification settings - Fork 5
Review notebook 6 "Calculate statistics" #8
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: review
Are you sure you want to change the base?
Conversation
Check out this pull request on You'll be able to see Jupyter notebook diff and discuss changes. Powered by ReviewNB. |
@@ -0,0 +1,873 @@ | |||
{ |
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.
This is an excellent attempt at explaining groupby with a diagram! However, I think it would be easier to understand if there were only 2 groups in the diagram, rather than 3. Part of the reason is that the 4 shades of green are difficult to distinguish between.
Reply via ReviewNB
@@ -0,0 +1,873 @@ | |||
{ |
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.
I didn't quite follow as to why you created titanic_subset
and did a groupby on it, and then separately did a groupby on titanic
, even though they have the same result (except for the data type of the result). I think there is a teaching point you were trying to emphasize by making that distinction, but I couldn't quite figure it out!
Reply via ReviewNB
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.
Thanks for noticing, I'll try to improve the _storyline_ . The reason to have the subset is to overcome the necessity of selecting a column (e.g. Age
) after the groupby
operator. As such, I can first explain
titanic.groupby("Sex").mean()
before doing titanic.groupby("Sex")["Age"].mean()
.
Maybe rather work without subset, just do titanic.groupby("Sex").mean()
, get a grouped-average result on all the columns (PassengerId,Survived,Pclass,Age,SibSp,Parch and Fare) and next, explain how to just go for a single column of interest?
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.
After trying out, I rather stick to:
titanic[["Sex", "Age"]].groupby("Sex").mean()
as the solution of the specific question. It is putting less attention to the subset as it was before, but still keep the focus on those two columns involved.
@@ -0,0 +1,873 @@ | |||
{ |
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.
No description provided.