dfply library data processing. Homepage: https://github.com/kieferk/dfply
## drop nan values
@dfpipe
def dropnan(df, *args, **kwargs):
return df.dropna()
## GENERAL FUNCTION to be applied on df and store in a new column
@make_symbolic
def f(x,y):
from numpy import sqrt
return sqrt(x**2+y**2)
data >> mutate(newcol=f(X.x,X.y))