How to Identify p (lag order) for ARIMA Model in Python here is my auto correlation plot.
Generated by the following python code.

from pandas.plotting import autocorrelation_plot 
from statsmodels.tsa.arima_model import ARIMA

def display_corelation(series):
    autocorrelation_plot(series)
    plt.show()


I know i can pass 1 or 2 in p by looking into the plot for the ARIMA Model.
My question is how i can generate the p value, 

how to calculate the lag order from some series by pandas or any library instead of plotting currently at the moment ?


model = ARIMA(history, order=(1,1,0))
Got it by following code:

    import pandas as pd    
    k=0
    highestCorr = 0
    for i in range(1,10):
        cor = pd.Series.autocorr(series, lag=i)
        if(cor &gt; highestCorr):
            highestCorr = cor
            k=i