aW1wb3J0IHBhbmRhcyBhcyBwZApmcm9tIG1hdHBsb3RsaWIgaW1wb3J0IHB5cGxvdCBhcyBwbHQKZnJvbSBzdGF0c21vZGVscy5ncmFwaGljcy50c2FwbG90cyBpbXBvcnQgcGxvdF9hY2YKCiMgTG9hZCB0aGUgZGF0YQpkZiA9IHBkLnJlYWRfY3N2KCd0c2xhLmNzdicpCgojIENvbnZlcnQgJ0RhdGUnIHRvIGRhdGV0aW1lIGZvcm1hdCBhbmQgc2V0IGFzIGluZGV4CmRmWydEYXRlJ10gPSBwZC50b19kYXRldGltZShkZlsnRGF0ZSddKQpkZiA9IGRmW1snRGF0ZScsICdBZGogQ2xvc2UnXV0uc2V0X2luZGV4KCdEYXRlJykKCiMgQ2hlY2sgZm9yIG1pc3NpbmcgdmFsdWVzCnByaW50KCZxdW90O01pc3NpbmcgdmFsdWVzOlxuJnF1b3Q7LCBkZi5pc251bGwoKS5zdW0oKSkKCiMgUGxvdCB0aGUgYXV0b2NvcnJlbGF0aW9uIGZ1bmN0aW9uCnBsb3RfYWNmKGRmWydBZGogQ2xvc2UnXSwgbGFncz01MCkKcGx0LnNob3coKQ==
import pandas as pd
from matplotlib import pyplot as plt
from statsmodels.graphics.tsaplots import plot_acf
# Load the data
df = pd.read_csv('tsla.csv')
# Convert 'Date' to datetime format and set as index
df['Date'] = pd.to_datetime(df['Date'])
df = df[['Date', 'Adj Close']].set_index('Date')
# Check for missing values
print("Missing values:\n", df.isnull().sum())
# Plot the autocorrelation function
plot_acf(df['Adj Close'], lags=50)
plt.show()