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を使ったデータ分析、機械学習
3.12
 時系列
193
2015-07-04 2
2015-08-04 3
dtype: int64
このデータは
Series
に入っているので、前の節で説明した
Series
のインデクスパターンに対し
て日付と解釈できるデータを渡すことができます。
In[13]: data['2014-07-04':'2015-07-04']
Out[13]: 2014-07-04 0
2014-08-04 1
2015-07-04 2
dtype: int64
また、年を渡して当該年すべての日付スライスを取得するなど、日付に対する特殊なインデクス
操作が追加されています。
In[14]: data['2015']
Out[14]: 2015-07-04 2
2015-08-04 3
dtype: i
nt64
日付をインデクスとすることによる利便性を高める例を後で紹介します。しかし、ここでは利用
可能な時系列のデータ構造を詳しく見ることとしましょう。
3.12.3
pandas
の時系列データ構造
この節では、時系列データを扱うための基本的な
pandas
データ構造を紹介します。
タイムスタンプ(timestamp)
pandas
Timestamp
す。 が、
Python
datetime
の代わりにとして使用できますが、より効率的な
numpy.datetime64
データ型に
基づいて実装されています。関連するインデクス構造は
DatetimeIndex
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