I have a dataframe like this:
A B C
396 1147.430 1147.219 0.000184
397 1147.110 1147.630 -0.000453
398 1146.870 1147.469 -0.000522
399 1147.110 1147.680 -0.000497
400 1147.170 1147.640 -0.000410
401 1147.210 1147.430 -0.000192
I want to take the Nth power for each cell in Column C and add them up. I know for squares I can use np.square(df['C']).sum(axis=0)
.
Is there a quick way to do this for other powers?