Skip to content

Instantly share code, notes, and snippets.

@h-okay
Last active Dec 20, 2021
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