NameError: name 'drop_outlier' is not defined
时间: 2024-01-06 11:24:10 浏览: 148
[] - 2022-12-22 Kaggle知识点:Sklearn异常检测方法.pdf
```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
```
阅读全文