作者zcyee (野战口粮)
看板Python
标题[问题] 有类似Excel筛选的功能吗?
时间Thu Oct 5 22:16:15 2017
因为我的资料有点乱 想要把没有销售价格的资料删除
假设我的销售栏 有些值为"-" 或 0
我想要删除那一整笔的资料
是用pop吗?
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 106.1.234.184
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/Python/M.1507212977.A.D1A.html
1F:→ s860134: [i for i in data if i not in [0,'-']] 10/06 00:36
2F:→ s860134: 後面的 if 可以是 i['销售'] in [0,'-'] 这样的写法 10/06 00:38
3F:推 extraymond: 也可以用pandas的dropna喔 10/06 14:32