Pandas has a built-in function called value_counts()
.
Example: if your DataFrame has a column with values as 0’s and 1’s, and you want to count the total frequencies for each of them, then simply use this:
df.colName.value_counts()
Pandas has a built-in function called value_counts()
.
Example: if your DataFrame has a column with values as 0’s and 1’s, and you want to count the total frequencies for each of them, then simply use this:
df.colName.value_counts()