Skip to Content
Pythonデータサイエンスハンドブック ―Jupyter、NumPy、pandas、Matplotlib、scikit-learnを使ったデータ分析、機械学習
book

Pythonデータサイエンスハンドブック ―Jupyter、NumPy、pandas、Matplotlib、scikit-learnを使ったデータ分析、機械学習

by Jake VanderPlas, 菊池 彰
May 2018
Intermediate to advanced
556 pages
13h 21m
Japanese
O'Reilly Japan, Inc.
Content preview from Pythonデータサイエンスハンドブック ―Jupyter、NumPy、pandas、Matplotlib、scikit-learnを使ったデータ分析、機械学習
202
3
章 
pandas
を使ったデータ操作
図3-9 現在までのGoole 株の投資利益率。
これは
Google
株の全体的なトレンドを把握するのに役立ちます。これまでのところ、
Google
株投資で最も収益性の高かった時期は(今から考えると、驚くべきことに)、新規株式公開(
IPO
initial public offering
)の直後と、
2009
年の景気後退時期の途中でした。
3.12.5.3
 移動する窓関数
pandas
の実装する時系列に特有な
3
番目の操作がローリング統計です。
groupby
操作(「3.9 集約
とグループ化」を参照してください)で紹介したような、ビューを
Series
および
DataFrame
オブジェ
クトの
rolling()
が返し、この操作はそのビューを介して行われます。このローリング・ビューは
多くの集約操作をデフォルトで提供しています。
例えば次に示すグラフは、
Google
株価の
1
年間の移動平均と移動標準偏差です( 3
-10)。
In[33]: rolling = goog.rolling(365, center=True)
data = pd.DataFrame({'input': goog,
'one-year rolling_mean': rolling.mean(),
'one-year rolling_std': rolling.std()})
ax = data.plot(style=['-', '--', ':'])
ax.lines[0].set_alpha(0.3) ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Pythonデータサイエンスハンドブック 第2版 ―Jupyter、NumPy、pandas、Matplotlib、scikit-learnを使ったデータ分析、機械学習

Pythonデータサイエンスハンドブック 第2版 ―Jupyter、NumPy、pandas、Matplotlib、scikit-learnを使ったデータ分析、機械学習

Jake VanderPlas, 菊池 彰
初めてのGraphQL ―Webサービスを作って学ぶ新世代API

初めてのGraphQL ―Webサービスを作って学ぶ新世代API

Eve Porcello, Alex Banks, 尾崎 沙耶, あんどうやすし

Publisher Resources

ISBN: 9784873118413Other