这是我的数据框输入 qid question_stemmed target question_length total_words443216 56da6b6875d686b48fde mathfracint1x53x5 tantanboxedint1x01x2 sumvarp... 1 589 40163583 1ffca149bd0a19cd714c mathoverbracesumvartheta8infty vecfracsumkappa... 1 498 31522266 663c7523d48f5ee66a3e httpgooglecom check out the content of the www.. 0 449 66522379 756678d3d48f5ee66a3e mark had a great day he plans to go fishing with. 0 310 23我正在使用以下逻辑仅从其 question_text 列具有的 df 返回记录任何长度不应超过 15 个字符的单词(注意:不是字符串长度)(使用否定)在上述条件为真时不应包含数值的任何单词(使用否定)同时确保保留具有 http 或 www 值的词(同时以上 2 个条件仍然成立)df = df[(~df['question_stemmed'].str.len() > 15) & (~df['question_stemmed'].str.contains(r'[0-9]')) & (df.question_stemmed.str.match('^[^\http]*$'))]出现错误 error: bad escape \h at position 3预期产出 qid question_stemmed target question_length total_words522266 663c7523d48f5ee66a3e httpgooglecom check out the content of the www.. 0 449 66522379 756678d3d48f5ee66a3e mark had a great day he plans to go fishing with. 0 310 23 另外,想知道上面的逻辑是否可以满足所有 3 个条件感谢任何帮助
添加回答
举报
0/150
提交
取消