Get your own Python server Result Size: 625 x 565
x
 
import pandas as pd
def calc_sum(x):
  return x.sum()
data = {
  "x": [50, 40, 30],
  "y": [300, 1112, 42]
}
df = pd.DataFrame(data)
x = df.apply(calc_sum)
print(x)
  x     120
  y    1454
  dtype: int64