Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

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}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #change #frequency #column #pandas
ADD COMMENT
Topic
Name
7+3 =