提交 5a1119cb 编写于 作者: W weixin_39521144

Thu Dec 26 17:18:00 CST 2024 inscode

上级 0a575cc3
print('欢迎来到 InsCode')
\ No newline at end of file
# import pandas as pd
# import numpy as np
# import matplotlib.pyplot as plt
# import seaborn as sns
# import urllib.request as urllib2
# import json
# def findPairs():
# ids = ['rb1903', 'rb1904', 'rb1905', 'rb1906', 'rb1907', 'rb1908']
# url_5m = 'http://stock2.finance.sina.com.cn/futures/api/json.php/IndexService.getInnerFuturesMiniKLine5m?symbol='
# result = []
# for id in ids:
# url = url_5m + id
# # print(url)
# req = urllib2.Request(url)
# rsp = urllib2.urlopen(req)
# res = rsp.read()
# res_json = json.loads(res)
# result.append(res_json)
# close_result = []
# for instrument in result:
# oneDay_list = []
# for oneDay in instrument:
# oneDay_list.append(float(oneDay[-2]))
# close_result.append(np.array(oneDay_list))
# close_result = np.array(close_result)
# close_result = close_result.T
# df = pd.DataFrame(data=close_result, columns=ids)
# df.plot()
# plt.show()
# if __name__ == "__main__":
# findPairs()
from IPython.display import display
import matplotlib.pyplot as plt
# 您的绘图代码
plt.plot([1, 2, 3, 4], [1, 4, 9, 16])
plt.title("Sample Plot")
# 强制显示图形
display(plt.gcf())
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册