STLDecompose icon indicating copy to clipboard operation
STLDecompose copied to clipboard

Cannot call stldecompose library

Open seckindinc opened this issue 5 years ago • 14 comments

Python version: 3.7.* Statsmodel version: statsmodels==0.11.0 Stldecompose version: stldecompose==0.0.5 Error: ImportError: cannot import name '_maybe_get_pandas_wrapper_freq' from 'statsmodels.tsa.filters._utils'

seckindinc avatar Jan 29 '20 13:01 seckindinc

Thanks for the report @seckindinc. I did a bit of commit spelunking and it seems like that util function was removed from the library. For a workaround until a better fix, you could try downgrading your statsmodels version and see if things still work ok.

jrmontag avatar Jan 30 '20 20:01 jrmontag

Thanks for the feedback. I used the same approach and it is working fine now.

On Thu, Jan 30, 2020 at 9:20 PM Josh Montague [email protected] wrote:

Thanks for the report @seckindinc https://github.com/seckindinc. I did a bit of commit spelunking and it seems like that util function was removed from the library. For a workaround until a better fix, you could try downgrading your statsmodels version and see if things still work ok.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jrmontag/STLDecompose/issues/17?email_source=notifications&email_token=AEALN4HRLCGVV2NMHEEIZ43RAMY7RA5CNFSM4KNEGNSKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEKMNOCY#issuecomment-580441867, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEALN4BHNFRVSBF6PZZV7CDRAMY7RANCNFSM4KNEGNSA .

seckindinc avatar Jan 30 '20 20:01 seckindinc

Thanks for the report @seckindinc. I did a bit of commit spelunking and it seems like that util function was removed from the library. For a workaround until a better fix, you could try downgrading your statsmodels version and see if things still work ok.

HI. I have installed version pip install --upgrade stldecompose==0.0.2 still have the same error

tiagocabo avatar Feb 25 '20 19:02 tiagocabo

Hi @tcabo, I think you'll need to specify an earlier version of statsmodels, not stldecompose

jrmontag avatar Feb 25 '20 23:02 jrmontag

Worked for me, thanks a lot.

gauravmys avatar May 09 '20 20:05 gauravmys

Did anyone got solution for this problem ?

ArbindChoubey avatar May 13 '20 19:05 ArbindChoubey

install an old version of statsmodel works for me pip install statsmodels==0.10.2

xchuwenbo avatar May 28 '20 02:05 xchuwenbo

Thanks! @xchuwenbo it worked for me

AnikethSDeshpande avatar Jun 12 '20 13:06 AnikethSDeshpande

Re-opening as reference as described here.

jrmontag avatar Jun 30 '20 20:06 jrmontag

As an additional tip for everyone, I need to use statsmodels 0.11.x to take advantage of some new state space models. There seems to be similar functionality in statsmodels now.

https://www.statsmodels.org/stable/generated/statsmodels.tsa.seasonal.STL.html#statsmodels.tsa.seasonal.STL

rbochz28 avatar Jul 10 '20 18:07 rbochz28

I have upgraded to statsmodels 0.12.0 to take advantage of STL functionality, but the stldecompose is not working for me. If I downgrade to statsmodels 0.10.2, then I would not be able to STL functionality. I am using the stldecomose for decompose and forecast. Please advise.

rahulsharma1208 avatar Oct 28 '20 03:10 rahulsharma1208

@rahulsharma1208 As is described just above your comment and in other issues, I would advise you to consider the newly added STL functionality in the statsmodels library.

This library was created to fill that functionality gap as it existed many years ago. Preferring an actively maintained library is a more future-proof choice!

jrmontag avatar Oct 29 '20 15:10 jrmontag

Try code below in stl.py file, if you install latest statsmodels.

from statsmodels.tsa.filters._utils import  _get_pandas_wrapper

_pandas_wrapper = _get_pandas_wrapper(df)

Tadelaide avatar Jun 07 '22 08:06 Tadelaide

from statsmodels.tsa.seasonal import seasonal_decompose decomp = seasonal_decompose(df_close, period=365)

JahangheerShaik avatar Jan 05 '24 19:01 JahangheerShaik