Coder Social home page Coder Social logo

hampel_filter's People

Contributors

michaelistrofficus avatar moteroaltostratus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

hampel_filter's Issues

issue when importing hampel

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).

Module not found with cron

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)?

Bias when applying Hampel filter

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:
newplot

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.

Series.fillna with 'method' is deprecated and will raise in a future version.

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().

rolling_median = rolling_ts.median().fillna(method='bfill').fillna(method='ffill')
rolling_sigma = k*(rolling_ts.apply(median_absolute_deviation).fillna(method='bfill').fillna(method='ffill'))

The warning should be easily fixed by replacing the call by ffill() / bfill().

Requirements

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.