假设我有一个DF:
students = [ ('jack', 34, 'Sydeny' , 'Australia') ,
('Riti', 30, 'Delhi' , 'India' ) ,
('Vikas', 31, 'Mumbai' , 'India' ) ,
('Neelu', 32, 'Bangalore' , 'India' ) ,
('John', 16, 'New York' , 'US') ,
('Mike', 17, 'las vegas' , 'US') ]
dfObj = pd.DataFrame(students, columns = ['Name' , 'Age', 'City' , 'Country'], index=['a', 'b', 'c' , 'd' , 'e' , 'f'])
我有一份清单:
[Vikas, Neelu, Jack]
如何从DF中删除包含此列表中元素的行。我的谷歌搜索只向我展示了如何按列索引或生命等条件删除某个列低于或高于某个整数值
~
一起使用(不是)李>忽略案例
'Jack'
与'jack'
不同str.lower
)Name
强制转换为带^{Name
列中的值保持不变李>请使用
.str.contains
并使用~
反向选择相关问题 更多 >
编程相关推荐