michaelistrofficus / hampel_filter Goto Github PK
View Code? Open in Web Editor NEWPython implementation of the Hampel Filter
License: MIT License
Python implementation of the Hampel Filter
License: MIT License
Hello
I am experiencing an error while importing hampel lib with my python3.8 :
I am not sure what to do with this. Would you have some hints?
thank you in advance,
best regards
Yoann
from hampel import hampel
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python3.8/dist-packages/hampel/init.py", line 1, in
from .hampel import hampel
File "/usr/local/lib/python3.8/dist-packages/hampel/hampel.py", line 5, in
from hampel.extension.hampel import hampel as hampel_extension
File "src/hampel/extension/hampel.pyx", line 1, in init hampel.extension.hampel
ImportError: numpy.core.multiarray failed to import (auto-generated because you didn't call 'numpy.import_array()' after cimporting numpy; use 'numpy._import_array' to disable if you are certain you don't need it).
Is the Hempel filter suitable for both nonparametric and normal data?
Hi,
I installed hampel on my computer and then on a server. It's called by a single python script using import hampel
when I run it manually or on a notebook it works perfect, however when it passes through a crontab I get this execution message
Traceback (most recent call last):
File "/mellisphera/rundata.py", line 13, in <module>
import hampel
ImportError: No module named 'hampel'
the server works with anaconda distribution
the module seems properly installed in
/opt/mellisphera/anaconda3/lib/python3.7/site-packages
and I've given it wide access rights to avoid any issue on that side
drwxrwxrwx 2 lorenzo mellisphera 4096 Jun 7 06:14 hampel-0.0.5.dist-info
-rwxrwxrwx 1 lorenzo mellisphera 2151 Jun 7 06:14 hampel.py
Any idea of why the batch mode cannot resolve this module (it resolves all others)?
Hi,
I am experiencing an "error" when applying hampel lib filter to data from a dataframe. Output data seems to have a bias in respect the original input data. Last lines of the output df are filled with NaN.
I am applying the filter as follows:
df_posthampel['A'] = hampel(df_prehampel['A'], window_size=10, n_sigma=3.0).filtered_data
Here a plot of the input raw data and the filtered:
Do you have news of something similar? Maybe I should modify window sizes, or just synchronize both columns after the filter.
Thank you in advance,
Best regards.
Line 27 in f897056
raise ValueError("Timeserie object must be of type pandas.Series.")
Line 48 in f897056
The window size should be 2*window_size + 1
Recent versions of pandas present a deprecation warning for Series.fillna, which is used in in this module:
/usr/local/lib/python3.11/site-packages/hampel.py:49: FutureWarning:
Series.fillna with 'method' is deprecated and will raise in a future version. Use obj.ffill() or obj.bfill() instead.
/usr/local/lib/python3.11/site-packages/hampel.py:50: FutureWarning:
Series.fillna with 'method' is deprecated and will raise in a future version. Use obj.ffill() or obj.bfill() instead.
Indeed the rolling median computation uses the fillna()
.
Lines 49 to 50 in f897056
The warning should be easily fixed by replacing the call by ffill()
/ bfill()
.
Hi,
great package! Is this maintained? Could you remove the fixed requirements?
"numpy>=1.19.2",
"pandas>=1.1.2"
],
extras_requires={
"dev": [
"pytest>=6.0.2"
]
},
python_requires='>=3.7',
I guess for the few lines of code, it should be fine without them? Or at least could you lower them? Also the Python version would be great to make at least >=3.6
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.