statsmodels.stats.diagnostic.acorr_ljungbox
statsmodels.stats.diagnostic.acorr_ljungbox(x, lags=None, boxpierce=False)
Ljung-Box test for no autocorrelation Parameters:
x : array_like, 1d data series, regression residuals when used as diagnostic test lags : None, int or array_like If lags is an integer then this is taken to be the largest lag that is included, the test result is reported for all smaller lag length. If lags is a list or array, then all lags are included up to the largest