Sign up to take part
Registered users can ask their own questions, contribute to discussions, and be part of the Community!
Registered users can ask their own questions, contribute to discussions, and be part of the Community!
HI
I have a dataset with a column a and I d like to compute the ewm using python code
def process(row):
row['a_ewm']=row['a'].ewm(span=30).mean()
return len(row['a_ewm'])
but it s mot working
can someone help me ?
Hi, what error do you get?
def process(row):
row['a_ewm']=row['a'].ewm(span=30).mean()
return len(row['a_ewm'])
Hi @Lesage,
It seems that ewm() is a function in Pandas library for exponentially weighted (EW) calculations.
https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.ewm.html
If you want to use this you need to create a Pandas Dataframe object and then call this function ewm().
This seems to require a series of data so if you want to calculate exponentially weighted mean of a column, row formula doesn't seem suitable for this because you will have access only to one row at a time.
How does your input data look like?
it s a csv file
i d like to transform some column to calculate ewm
how I can do that ?