Skip to content

Instantly share code, notes, and snippets.

@h-okay
Last active December 20, 2021 14:28
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
EDA for Level Based
# Unique Sources and Frequencies
df.SOURCE.value_counts()
# Unique Prices and Frequencies
df.PRICE.value_counts()
# Unique Countries and Frequencies
df.COUNTRY.value_counts()
# Total Income Accumulated by Countries
df.groupby('COUNTRY').PRICE.sum()
# Average Income Accumulated by Countries
df.groupby('COUNTRY').PRICE.mean()
# Average Income Accumulated by Sources
df.groupby('SOURCE').PRICE.mean()
# Average Income Accumulated by Countries and Sources
df.groupby(['COUNTRY', 'SOURCE']).PRICE.mean()
# Average Income Accumulated by Countries, Sources, Sex and Age
df.groupby(['COUNTRY', 'SOURCE', 'SEX', 'AGE']).PRICE.mean()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment