データの可視化

Intermediate Python for Finance

Kennedy Behrman

Data Engineer, Author, Founder

データを確認

株価のグラフ

Intermediate Python for Finance
exxon.head()
Intermediate Python for Finance

データの紹介

exxon.head()
    Date         High        Volume      Month
0   2015-05-01   90.089996   198924100   May
1   2015-06-01   85.970001   238808600   Jun
2   2015-07-01   83.529999   274029000   Jul
3   2015-08-01   79.290001   387523600   Aug
4   2015-09-01   75.470001   316644500   Sep

Intermediate Python for Finance

Matplotlib

my_dataframe.plot()
Intermediate Python for Finance

折れ線グラフ

exxon.plot(x='Date', 
           y='High' )
Intermediate Python for Finance

株価の折れ線グラフ

Intermediate Python for Finance

回転

exxon.plot(x='Date', 
           y='High', 
           rot=90 )
Intermediate Python for Finance

ラベルを回転した折れ線グラフ

Intermediate Python for Finance

タイトル

exxon.plot(x='Date', 
           y='High', 
           rot=90, 
           title='Exxon Stock Price')
Intermediate Python for Finance

タイトル付き折れ線グラフ

Intermediate Python for Finance

インデックス

exxon.set_index('Date', inplace=True)
exxon.plot(y='High', 
           rot=90, 
           title='Exxon Stock Price')
Intermediate Python for Finance

インデックスをx軸にした折れ線グラフ

Intermediate Python for Finance

プロットの種類

  • line
  • bar
  • barh
  • hist
  • box
  • kde
  • density
  • area
  • pie
  • scatter
  • hexbin
Intermediate Python for Finance

棒グラフ

exxon2018.plot(x='Month', 
               y='Volume', 
               kind='bar', 
               title='Exxon 2018')
Intermediate Python for Finance

棒グラフ

Intermediate Python for Finance

ヒストグラム

exxon.plot(y='High',kind='hist')
Intermediate Python for Finance

ヒストグラム

Intermediate Python for Finance

演習に進みましょう!

Intermediate Python for Finance

Preparing Video For Download...