1 Upvote

Creating a Frequency Table from a Dataframe Column

Python
Visualisation & EDA

#Counts for each value in order_value column 
df['order_value'].value_counts()

#Counts aggregated into 5 bins
df['order_value'].value_counts(bins=5)

#Counts aggregated into 5 bins and sorted by order_value bin
df['order_value'].value_counts(bins=5).sort_index()

By analyseup - Last Updated June 11, 2022, 2:31 p.m.

Did you find this snippet useful?

Sign up to bookmark this in your snippet library

COMMENTS
RELATED SNIPPETS
2
Top Contributors
103
100