Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: module 'scipy.stats' has no attribute 'median_absolute_deviation' #123

Closed
MislavSag opened this issue Sep 9, 2022 · 5 comments

Comments

@MislavSag
Copy link

Hi,

I have installed tsfel in an empty virtual environment inside Dockerfile:

# install python and packages
RUN apt-get -y install python3 python3-venv python3-pip
RUN python3 -m venv /home/rstudio/venv
RUN /home/rstudio/venv/bin/pip3 install --upgrade pip setuptools wheel
RUN /home/rstudio/venv/bin/pip3 install tsfel

When I want to extract all features, I get an error:

! AttributeError: module 'scipy.stats' has no attribute 'median_absolute_deviation'
@MislavSag
Copy link
Author

On this site: https://github.com/scipy/scipy/releases/tag/v1.9.0

it says

Removed stats.median_absolute_deviation

Maybe the package doesn't work with scipy 1.9.0 and above ?

@dmfolgado
Copy link
Member

dmfolgado commented Sep 9, 2022

Hi! Correct, the latest scipy stable released has changed the name to scipy.stats.median_abs_deviation. We'll look onto this. For now I recommend that you downgrade the scipy release (e.g. pip install scipy==1.8.1).

@ErikHodges
Copy link

ErikHodges commented Oct 19, 2022

Hi! Correct, the latest scipy stable released has changed the name to scipy.stats.median_abs_deviation. We'll look onto this. For now I recommend that you downgrade the scipy release (e.g. pip install scipy==1.8.1).

To fix this, I changed line 661 of the '\tsfel\feature_extraction\features.py' script from:

return scipy.stats.median_absolute_deviation(signal, scale=1)
--to--
return scipy.stats.median_abs_deviation(signal, scale=1)

Hope this helps!

@sp435
Copy link

sp435 commented Dec 15, 2022

Restarted the system after making the change. It works. Thank you!

@mluacnunes
Copy link
Contributor

Updated on new release v0.1.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants