count proportion pandas

Solutions on MaxInterview for count proportion pandas by the best coders in the world

showing results for - "count proportion pandas"
Lea
18 Apr 2019
1import pandas as pd
2
3dogs = pd.DataFrame({
4    'dog_name':['REX', 'WALTER', 'BLAZE', 'JASPER', 'TEDDY'], 
5    'breed':['KOBE', 'OSCAR', 'OSCAR', 'KOBE', 'MAX']
6})
7
8print(dogs.value_counts(normalize=True))