fork download
  1.  
Success #stdin #stdout 0.05s 9520KB
stdin
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()
stdout
Standard output is empty