'Pandas autocorrelation plot never finishes
I am trying to plot the autocorrelation plot from some pandas series with a lot of data (over 2 million datapoints in the csv file), but when I call pandas.plotting.autocorrelation_plot(series), it never gets to finish.
Instead, when I do it on some series from another file with just a couple thousand lines it takes barely seconds. It's been 2 days since I executed the script and it still hasn't finished. Is the problem that complex or am I doing something wrong? I leave my script here:
import pandas as pd
import matplotlib.pyplot as plt
import random
symbol = "BTCUSDT.csv"
df = pd.read_csv(f"../../data/1m/{symbol}")
closes = df.copy().iloc[:, 4]
plot = pd.plotting.autocorrelation_plot(closes, label = symbol.split(".")[0])
curve = plot.plot()
plt.axhline(y = 0.9, color = 'g', linestyle = 'dashed')
plt.axhline(y = 0.85, color = 'b', linestyle = 'dotted')
plt.axhline(y = 0.8, color = 'r', linestyle = 'dashed')
plot.figure.suptitle("Autocorrelation plots", fontsize=20)
plt.show()
When I call the script like that, it takes ages (and still hasn't finished yet), but when I do it over smaller files it works just fine. Any help would be really appreciated. Thank you all in advance!
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|