FChm
FChm

Reputation: 2600

Pandas: where is autocorrelation_plot?

I'm trying to plot an autocorrelation_plot() of a time series using pandas. According to this SO post pandas.tools was removed in 0.24.0 and the autocorrelation_plot function can now be found in the pandas.plotting library. However the API shows no reference to this function.

I'm able to plot an autocorrelation by importing the function but where can I find the documentation?

from pandas.plotting import autocorrelation_plot # works fine

slope = -1
offset = 250
noise_scale = 100
npts = 100

x = np.linspace(0, 100, npts)
y = slope*x + noise_scale*np.random.rand(npts) + offset

autocorrelation_plot(y)

auto_correlation-plot

Python: 3.7.2

Pandas: 0.24.1

Upvotes: 1

Views: 3828

Answers (3)

Marc Garcia
Marc Garcia

Reputation: 3497

I think this would probably be more appropriate as an issue in GitHub.

In any case, autocorrelation_plot and the similar plots (andrews_curves, radviz,...) are probably going to be moved out of pandas, into a separate package. So you can expect to have to call something like pandas_matplotlib.autocorrelation_plot() in the future (see #28177).

In the meantime, I'm adding it and some other missing functions to the documentation in #28179. When the pull request is merged, you'll be able to see the docs in https://dev.pandas.io. But there is nothing very interesting for autocorrelation_plot:

enter image description here

Upvotes: 2

dubbbdan
dubbbdan

Reputation: 2740

Have a look at:

https://github.com/pandas-dev/pandas/blob/v0.24.1/pandas/plotting/_misc.py#L600

Looks like it was buried in the plotting._misc source code.

Upvotes: 0

Related Questions