python当增加自定义时间序列绘图函数中的滞后数时,Jupyter内核停止

python当增加自定义时间序列绘图函数中的滞后数时,Jupyter内核停止,python,pandas,time-series,jupyter-notebook,statsmodels,Python,Pandas,Time Series,Jupyter Notebook,Statsmodels,我有下面的代码,它定义了一个时间序列绘图函数并显示更完整的统计信息 def tsplot(y, lags=None, figsize=(12, 7), style='bmh'): if not isinstance(y, pd.Series): y = pd.Series(y) with plt.style.context(style): fig = plt.figure(figsize=figsize) layou

我有下面的代码,它定义了一个时间序列绘图函数并显示更完整的统计信息

    def tsplot(y, lags=None, figsize=(12, 7), style='bmh'):
    if not isinstance(y, pd.Series):
        y = pd.Series(y)
    with plt.style.context(style):    
        fig = plt.figure(figsize=figsize)
        layout = (2, 2)
        ts_ax = plt.subplot2grid(layout, (0, 0), colspan=2)
        acf_ax = plt.subplot2grid(layout, (1, 0))
        pacf_ax = plt.subplot2grid(layout, (1, 1))

        y.plot(ax=ts_ax)
        ts_ax.set_title('Time Series Analysis Plots')
        smt.graphics.plot_acf(y, lags=lags, ax=acf_ax, alpha=0.5)
        smt.graphics.plot_pacf(y, lags=lags, ax=pacf_ax, alpha=0.5)

        print("Adfuller: p=%f" % sm.tsa.stattools.adfuller(y)[1])

        plt.tight_layout()
    return 
tsplot(dataset.Users, lags=30)
试图在我的数据上打印不同延迟数的曲线图,我遇到了一个问题。当lags=10时,一切都运行良好,例如,当我将lags的数量增加到30-35个Jupyter内核关闭时(可能没有,但我等待了大约20分钟,没有得到任何结果)。例如,它也适用于lags=31,而不适用于lags=32。我在这里找不到任何依赖项。试图在Jupyter和Jupyter实验室中进行此操作。无法找出问题所在

数据集包含一些300天的观察结果


我在时间序列分析方面比较新。如果您能帮助您找出延迟数增加时此功能不起作用的原因,我们将不胜感激。

您能否确认关闭,或至少使用系统首选的进程监视器(windows上的任务管理器、mac上的活动监视器、top on*nix)监视资源使用情况?将于明天早上在办公室完成,并回复意见。我的家用电脑上没有笔记本。不幸的是,statsmodels adfuller将滞后搜索的所有结果都保存在内存中。您可以尝试注释掉adfuller行,看看它是否会影响内存问题。但是,它不依赖于函数中的
滞后
,因此我在statsmodels端没有看到任何应该使用大量内存作为
滞后
函数的内容。