Python ';str.contains';不在dataframe中返回值
我正在清理一些文本数据,但找不到包含某些字符串的行。如果我做一个简单的布尔运算,我得到:Python ';str.contains';不在dataframe中返回值,python,string,pandas,Python,String,Pandas,我正在清理一些文本数据,但找不到包含某些字符串的行。如果我做一个简单的布尔运算,我得到: '<! [CDATA[! function( d,s, id){varjs, fjs=d. getElementsByTagName( s)[0],p= ^' in articles.loc[25111, 'content'] True ”我认为一些值被读取为regex,因此需要参数regex=Falsein s= articles[articles['content'].str.contains
'<! [CDATA[! function( d,s, id){varjs, fjs=d. getElementsByTagName( s)[0],p= ^' in articles.loc[25111, 'content']
True
”我认为一些值被读取为regex,因此需要参数regex=False
in
s=
articles[articles['content'].str.contains('<! [CDATA[! function( d,s, id){varjs, fjs=d. getElementsByTagName( s)[0],p= ^')]
id title author date content year month publication category digital section url stems
s = '<! [CDATA[! function( d,s, id){varjs, fjs=d. getElementsByTagName( s)[0],p= ^'
articles[articles['content'].str.contains(s, regex=False)]