Closed ray-bun closed 6 years ago
Any help pls? Thank you
Should be pd.ewma
. Please show me the error when you try ewma
. Also try the following thread: https://github.com/pandas-dev/pandas/issues/14666
Error below:
test.py", line 42, in
Sorry, based on that thread what am I changing?
Hmmm even if ewma
doesn't work, ewm
should still be available in the latest pandas version as you can see here: https://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.ewm.html. Make sure you have pandas installed correctly.
I have installed correctly and it is showing in my pip3 list. What version are you using? Could you try it with your latest version? I'm on Pandas 23.4 and can confirm that it doesnt work AttributeError: module 'pandas' has no attribute 'ewm'
If i try this ups_avg = pd.DataFrame.ewm(ups, span=RSI_N)[-1] downs_avg = -pd.DataFrame.ewm(downs, span=RSI_N)[-1]
Traceback (most recent call last):
File "C:/Users/xx/PycharmProjects/rsi/rsi_1min_candle.py", line 128, in
if I run it with Pandas 0.18.0 FutureWarning: pd.ewm_mean is deprecated for ndarrays and will be removed in a future version downs_avg = -pd.ewma(downs, span=RSI_N)[-1]
still an issue, any help pls?
I wasn't able to figure out the problem. I would suggest updating that line of code to use the new API. You can ask on StackOverflow for how to achieve the same functionality with other library methods
ewm is a Dataframe function now, no more a top one. It changed to pd.Dataframe.ewm(com=None, span=None, halflife=None, alpha=None, min_periods=0, adjust=True, ignore_na=False, axis=0)
according to the docs.
Hi, did you have any solution for this? Im trying to calculate RSI with binance client. thanks
df['short_ema'] = df.groupby('code')['price_close'].ewma(span=12).mean().reset_index(drop=True) File "/usr/local/python3/lib/python3.6/site-packages/pandas/core/groupby/groupby.py", line 704, in getattr f"'{type(self).name}' object has no attribute '{attr}'"
Im using the latest pandas version. I have tried pd.ewm and pd.ewma but with no luck
Thanks