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.3
 インデクスとデータの選択
107
In[35]: indA = pd.Index([1, 3, 5, 7, 9])
indB = pd.Index([2, 3, 5, 7, 11])
In[36]: indA & indB # intersection
積集合
Out[36]: Int64Index([3, 5, 7], dtype='int64')
In[37]: indA | indB # union
和集合
Out[37]: Int64Index([1, 2, 3, 5, 7, 9, 11], dtype='int64')
In[38]: indA ^ indB # symmetric difference
対称差
Out[38]: Int64Index([1, 2, 9, 11], dtype='int64')
これらの操作は、オブジェクトメソッド、例えば
indiA.intersection(indB)
を使っても行えま
す。
3.3
 インデクスとデータの選択
2
章では、
NumPy
配列の値にアクセスし、値を設定したり、変更するための手段とツール、
つまりインデクス(例えば、
arr[1, 5]
)、マスク(例えば、
arr[arr > 0]
)、ファンシーインデクス
(例えば、
arr[0, [1, 5]]
)、それらの組み合わせ(例えば、
arr[
, [1, 5]]
)ついて詳しく説明し
ました。ここでは、
pandas
Series
および
DataFrame
オブジェクトの値にアクセスして値を変
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