Bonjour,
Je désirerais faire une une moyenne mobile sur un un grand nombre de données (+/- 90 000)
Mais je voudrais m’entrainer avec ce que propose le WEB.
Apparement, j’ai mal installé pandas.
Voici le code :
import pandas as pd
import numpy as np
data = np.array([10,5,8,9,15,22,26,11,15,16,18,7])
d = pd.Series(data)
print(d.rolling(4).mean())
Et les erreurs ci-dessous.
Je suis un peu perdu pour une bête moyenne mobile…
Une idée pour m’aider ?
Merci !
Python 3.9.2 (/usr/bin/python3)
>>> %Run test_moyenne_mobile.py
Traceback (most recent call last):
File "/home/pi/programmes/pgm/test_moyenne_mobile.py", line 1, in <module>
import pandas as pd
File "/home/pi/.local/lib/python3.9/site-packages/pandas/__init__.py", line 22, in <module>
from pandas.compat import is_numpy_dev as _is_numpy_dev
File "/home/pi/.local/lib/python3.9/site-packages/pandas/compat/__init__.py", line 15, in <module>
from pandas.compat.numpy import (
File "/home/pi/.local/lib/python3.9/site-packages/pandas/compat/numpy/__init__.py", line 4, in <module>
from pandas.util.version import Version
File "/home/pi/.local/lib/python3.9/site-packages/pandas/util/__init__.py", line 1, in <module>
from pandas.util._decorators import ( # noqa:F401
File "/home/pi/.local/lib/python3.9/site-packages/pandas/util/_decorators.py", line 14, in <module>
from pandas._libs.properties import cache_readonly # noqa:F401
File "/home/pi/.local/lib/python3.9/site-packages/pandas/_libs/__init__.py", line 13, in <module>
from pandas._libs.interval import Interval
File "pandas/_libs/interval.pyx", line 1, in init pandas._libs.interval
ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 48 from C header, got 40 from PyObject
>>>