для этого есть функция в пандах: Series.value_counts
:
value_count=df['Deviation from Partisanship'].value_counts()
count_0=value_count[0]
#count_0=value_count['0'] # if it is str
count_1=value_count[1]
#count_1=value_count['1'] # if it is str
Вот пример:
print(df)
Mnth Income
0 Jan 80
1 Feb 80
2 Mar 50
3 April 60
4 May 60
value_count=df['Income'].value_counts()
print(value_count)
60 2
80 2
50 1
Name: Income, dtype: int64
count_60 = value_count[60]
print(count_60)
#2