平时作业
Signed-off-by: 吴沂钊 <13190667+Yizhao_Wu4926@user.noreply.gitee.com>
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 64 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
File diff suppressed because one or more lines are too long
Binary file not shown.
|
After Width: | Height: | Size: 18 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 63 KiB |
@@ -0,0 +1,17 @@
|
||||
import matplotlib
|
||||
import pandas as pd
|
||||
from datetime import datetime
|
||||
from matplotlib import pyplot as plt
|
||||
plt.rcParams['axes.unicode_minus']=False
|
||||
plt.rcParams['font.sans-serif']='SimHei'
|
||||
matplotlib.style.use('ggplot')
|
||||
data_trading_hour=pd.read_csv("aapl-trading-hour.csv")
|
||||
data_trading_hour["Close"].plot()
|
||||
plt.title('股价走势(每秒盘收价)')
|
||||
plt.show()
|
||||
change=data_trading_hour["Close"].diff()/data_trading_hour["Close"]
|
||||
change.plot()
|
||||
plt.title('秒级收盘价变化率')
|
||||
plt.show()
|
||||
print(change.shift(1).corr(change))
|
||||
print(change.shift(2).corr(change))
|
||||
Reference in New Issue
Block a user