I have a dataframe with column A and B. I want to create a third column which is square root of the sum of squares of two columns.
Below is my sample data:
A B
10 7
10 8
9 8
10 11
13 5
3 0
12 8
12 9
11 10
10 11
Below is the code that I have tried:
df['vib_mot_sqrt'] = df[(np.sqrt(df['X']**2) + (df['index']**2))]
KeyError: "None of [Float64Index([6.0, 6.0, 11.0, 15.0, 16.0, 33.0, 42.0, 55.0, 73.0, 87.0], dtype='float64')] are in the [columns]"