apply function and def

PHOTO EMBED

Wed Jul 14 2021 15:19:10 GMT+0000 (Coordinated Universal Time)

Saved by @QuinnFox12 #textpreprocessing #nlp #function #pandas

rmsval = df.loc[:, 'c1':'c4']
def getrms(row):  
  a = np.sqrt(sum(row**2/4))
  return a
df['rms'] = df.apply(getrms,axis=1)
df.head()
content_copyCOPY