【发布时间】:2020-08-22 19:24:38
【问题描述】:
我正在使用df=df.drop(index='historical book') 删除所有包含historical book 的行。
第一行是标题
id name book subject amount
1 name1 historical book 6
2 name2 literature book 9
3 name3 historical book 4
我收到一个错误,它是 not found in axis。你知道为什么吗?
谢谢!
【问题讨论】:
-
使用:
df[df['subject'] != 'historical book']
标签: python pandas numpy jupyter-notebook data-visualization