Skip to content

Small bug in displaying groupby with pandas data frame #59

Description

So in 01 - Data Exploration.ipynb notebook we have
print(df_students.groupby(df_students.Pass)['StudyHours', 'Grade'].mean()) , but this gives an error below.
ValueError: Cannot subset columns with a tuple with more than one element. Use a list instead.

Solution:

Change it to print(df_students.groupby(df_students.Pass)[['StudyHours', 'Grade']].mean()) to fix and resolve it.

Note:
A very small but important fix.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions