Last active
February 22, 2021 07:42
-
-
Save makispl/9e12830bf1d6fc305f985f39ec572621 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Fing the unique categories | |
df.category.value_counts() | |
# Subset the df by the category column | |
sngl_mlt = df[df['category'] == 'Single Malt Scotch'].copy() | |
blnd = df[df['category'] == 'Blended Scotch Whisky'].copy() | |
blnd_mlt = df[df['category'] == 'Blended Malt Scotch Whisky'].copy() | |
# Calculate the mean of numerical columns | |
df.groupby('category').agg(np.mean) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment