Skip to content

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

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

Conversation

jorisvandenbossche
Copy link
Collaborator

No description provided.

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

You'll be able to see Jupyter notebook diff and discuss changes. Powered by ReviewNB.

@@ -0,0 +1,873 @@
{
Copy link

@justmarkham justmarkham Sep 27, 2019

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

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

Copy link
Owner

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?

Copy link
Owner

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 @@
{
Copy link

@justmarkham justmarkham Sep 27, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: "Nan" should be "NaN"


Reply via ReviewNB

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