Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

pandas value_counts multiple columns

In [212]:
df = pd.DataFrame(np.random.randint(0, 2, (10, 4)), columns=list('abcd'))
df.apply(pd.Series.value_counts)
Out[212]:
   a  b  c  d
0  4  6  4  3
1  6  4  6  7
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #pandas #multiple #columns
ADD COMMENT
Topic
Name
6+2 =