Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

value_count pandas change column name

df = df.value_counts().rename_axis('unique_values').reset_index(name='counts')
print (df)
   unique_values  counts
0              2       3
1              1       2
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #pandas #change #column
ADD COMMENT
Topic
Name
3+5 =