我有df
subdomain search_engine search_term
0 vk.com None None
1 vk.com None None
2 facebook.com None None
3 vk.com None None
4 vk.com None vkontakte
我需要4 vk.com None vkontakte
我试试
df[~df.search_term.str == r"None"]
但它会返回TypeError: bad operand type for unary ~: 'StringMethods'
答案 0 :(得分:1)
我认为应该这样做:
document.documentElement.innerHTML
或者这会起作用:
In[75]:df[df.search_term.str.strip()!='None']
Out[75]:
subdomain search_engine search_term
4 vk.com None vkontakte