Answers for "python dataframe sum each column"

6

sum of a column in pandas

Total = df['MyColumn'].sum()
print (Total)
319
Posted by: Guest on June-01-2021
0

dataframe summarize how many in each column

In [8]: titanic[["Sex", "Age"]].groupby("Sex").mean()
Out[8]: 
              Age
Sex              
female  27.915709
male    30.726645
Posted by: Guest on June-18-2021

Python Answers by Framework

Browse Popular Code Answers by Language