Example simple dataframe definition:
df = pd.DataFrame({'A':[2,4,1],'B':[8,4,1],'C':[6,2,7]})
df
A B C
0 2 8 6
1 4 4 2
2 1 1 7
Trying to understand the difference in the calls for the function argument in the chunks below:
df.apply(sum)
df.apply('sum')
Both seem to give the same correct result:
A 7
B 13
C 15
dtype: int64
I understand that for this simple example I could have used the DataFrame sum() function directly but the question came from a more convoluted code.