Python-株-グラフに主要財務指標が表示されます
1276 ワード
ダウンロードした株の財務指標をグラフで表示(エンターテインメントのみ)し、Chineseは漢字の出力を定義するライブラリであり、他人のコードベースが修正され、変更時に貼り付けられている(手元のパソコンにはない).
新浪からデータをダウンロードしてみたこともあるが、つかんだ表はあまり入手できず、網易の財経データ処理が便利だ.
import matplotlib.pyplot as plt
import pandas as pd
from pandas.core.frame import DataFrame
import time
import Chinese as fnt
fnt.set_ch('YH', 12)
df_jbcwzb = pd.read_excel('./ - /html-' + time.strftime("%Y%m", time.localtime()) + '- - - .xlsx')
data_reportDate = df_jbcwzb.ix[0, 1:].sort_index(ascending=False)
plt.rc('xtick', labelsize=8)
plt.rc('ytick', labelsize=8)
plt.subplot(311)
#
data_jbmgsy = df_jbcwzb.ix[1, 1:].replace('--', '0').sort_index(ascending=False)
plt.plot(data_reportDate, data_jbmgsy.astype(float), label='a')
plt.legend()
plt.xticks(rotation=90)
# plt.xlabel(' ')
plt.ylabel(' ')
plt.title('600366- ')
plt.subplot(312)
#
data_kfjlr = df_jbcwzb.ix[11, 1:].replace('--', '0').sort_index(ascending=False)
plt.plot(data_reportDate, data_kfjlr.astype(float), label='a')
plt.legend()
plt.xticks(rotation=90)
plt.xlabel(' ')
plt.ylabel(' ')
plt.title('600366- ')
plt.show()
新浪からデータをダウンロードしてみたこともあるが、つかんだ表はあまり入手できず、網易の財経データ処理が便利だ.