NameError: name 'drop_outlier' is not defined
时间: 2024-01-06 07:24:10 浏览: 143
LOF.rar_LOF_outlier_outlier detection
```python
import pandas as pd
import numpy as np
# Run the following steps to investigate the existence of this first fact by plotting the histogram of returns and a Q-Q plot.
import yfinance as yf
df = yf.download('^GSPC', start='1985-01-01', end='2018-12-31', progress=False)
df = df[['Adj Close']].rename(columns={'Adj Close': 'adj_close'})
df['log_rtn'] = np.log(df.adj_close / df.adj_close.shift(1))
df = df[['adj_close', 'log_rtn']].dropna(how='any')
df
```
阅读全文