[Python] Error after importing auto_arima from pmdarima in Google Colab w/ time series analysis

Discussão em 'Python' iniciado por Stack, Agosto 1, 2025.

  1. Stack

    Stack Membro Participativo

    I'm encountering the error at the bottom when I try to run the following auto_arima function from the pmdarima package in Google Colab:

    !pip install pmdarima
    # Import the auto_arima function
    from pmdarima.arima import auto_arima

    # Load your dataset
    data = medical_timeseries

    # Run auto_arima to find the best ARIMA model parameters
    auto_arima_model = auto_arima(train_set, start_p=1, start_q=1,
    test='adf', # use adftest to find optimal 'd'
    max_p=3, max_q=3, # maximum p and q
    m=1, # frequency of series
    d=optimal_d, # let model determine 'd'
    seasonal=True, # Seasonality
    start_P=0,
    D=0,
    trace=True,
    error_action='ignore',
    suppress_warnings=True,
    stepwise=True)

    print(auto_arima_model.summary())
    #arima model


    ---------------------------------------------------------------------------
    ValueError Traceback (most recent call last)
    /tmp/ipython-input-2-3505055922.py in <cell line: 0>()
    1 get_ipython().system('pip install pmdarima')
    2 # Import the auto_arima function
    ----> 3 from pmdarima.arima import auto_arima
    4
    5 # Load your dataset

    4 frames
    /usr/local/lib/python3.11/dist-packages/pmdarima/utils/array.py in <module>
    11
    12 from ..compat import DTYPE
    ---> 13 from ._array import C_intgrt_vec
    14
    15 __all__ = [

    pmdarima/utils/_array.pyx in init pmdarima.utils._array()

    ValueError: numpy.dtype size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject

    ---------------------------------------------------------------------------


    Other code blocks before this ran fine and the variables are defined. Gemini also suggested: The error you're seeing, ValueError: numpy.dtype size changed, may indicate binary incompatibility, is a common issue when different Python packages that rely on numpy are installed with conflicting versions. This can happen when a package like pmdarima requires a specific version of numpy that is not compatible with other installed packages or the existing numpy installation.

    Continue reading...

Compartilhe esta Página