Answers for "change the frequency to column in pandas"

0

change the frequency to column in pandas

print df['status'].value_counts()
N    14
S     4
C     2
Name: status, dtype: int64

counts = df['status'].value_counts().to_dict()
print counts
{'S': 4, 'C': 2, 'N': 14}
Posted by: Guest on May-31-2021

Code answers related to "change the frequency to column in pandas"

Python Answers by Framework

Browse Popular Code Answers by Language