【发布时间】:2015-11-04 08:20:08
【问题描述】:
用 Google 搜索了一下,似乎找不到任何关于此的内容。
是否可以使用“非索引”访问 pandas 数据框中的数据? 所以像
df_index = asdf = pandas.MultiIndex(levels=[
['2014-10-19', '2014-10-20', '2014-10-21', '2014-10-22', '2014-10-30'],
[u'after_work', u'all_day', u'breakfast', u'lunch', u'mid_evening']],
labels=[[0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 4, 4, 4, 4],
[4, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 2, 0, 1, 3, 4]],
names=[u'start_date', u'time_group'])
然后我希望能够调用以下命令以获取不在df_index 中的所有内容
df.ix[~df_index]
我知道您可以在 pandas 中进行逻辑索引。只是好奇我是否可以使用索引对象来做到这一点
【问题讨论】: