{"version":"1.0","categories":["Python3.X"],"blog_title":"Research Note\uff01\uff01","height":"190","published":"2017-01-20 22:32:02","url":"https://publicjournal.hatenablog.com/entry/2017/01/20/223202","type":"rich","author_url":"https://blog.hatena.ne.jp/shu10038/","blog_url":"https://publicjournal.hatenablog.com/","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fpublicjournal.hatenablog.com%2Fentry%2F2017%2F01%2F20%2F223202\" title=\"Python,Pandas:\u30c7\u30fc\u30bf\u30d5\u30ec\u30fc\u30e0\u64cd\u4f5c - Research Note\uff01\uff01\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","author_name":"shu10038","provider_url":"https://hatena.blog","width":"100%","title":"Python,Pandas:\u30c7\u30fc\u30bf\u30d5\u30ec\u30fc\u30e0\u64cd\u4f5c","image_url":null,"provider_name":"Hatena Blog","description":"In [11]: import pandas as pd In [12]: import numpy as np In [13]: df = pd.DataFrame(np.array([[1,1,1,1],[1,'A',1,'B'],[1,'A',1,'B'],[1,1,1,'B']]), columns=['C1','C2','C3','C4']) In [14]: df[df['C2']=='A'][['C2','C4']] Out[14]: C2 C4 1 A B 2 A B"}