colors.csv
id name rgb is_trans
0 -1 Unknown 0033B2 f
1 0 Black 05131D f
2 1 Blue 0055BF t
How do you count how many f & t, (something like below)
colors_summary = colors.count('is_trans')
print(colors_summary)
Looking for Result
is_trans id name rgb
f 107 107 107
t 28 28 28
colors? Is this a pandas dataframe? How is this question related to csv?Counterclass fromcollectionsbuilt-in module, but only if that's not a pandasDataFrame.pandastag while you're at it.df.groupby('is_trans').count().reset_index()?