python dataframe add row with counts code example
Example 1: pandas count rows with value
len(df[df['score'] == 1.0])
Example 2: pandas count all values in whole dataframe
df.stack().value_counts()
len(df[df['score'] == 1.0])
df.stack().value_counts()