Python 正在清理LexisNexis txt文件,ZeroDivisionError

Python 正在清理LexisNexis txt文件,ZeroDivisionError,python,csv,text,jupyter,Python,Csv,Text,Jupyter,我正在尝试使用Neal Caren的Python脚本清理一些NexisLexis新闻数据。但是,当我尝试运行它时,这一行给出了一个错误: meta_list=[m for m in meta_list if float(lnraw.count(m))/(len(workfile)>.20)] 工作文件为: workfile=re.sub(' Copyright .*?\\r\\n','ENDOFILE',lnraw) workfile=workfile.r

我正在尝试使用Neal Caren的Python脚本清理一些NexisLexis新闻数据。但是,当我尝试运行它时,这一行给出了一个错误:

meta_list=[m for m in meta_list if float(lnraw.count(m))/(len(workfile)>.20)]
工作文件为:

workfile=re.sub('                Copyright .*?\\r\\n','ENDOFILE',lnraw) 
workfile=workfile.replace('\xef\xbb\xbf\r\n','')
workfile=workfile.split('ENDOFILE')
workfile=[f for f in workfile if len(f.split('\r\n\r\n'))>2]
我似乎无法修复它,非零条件似乎确实符合>.20?

(len(工作文件)>.20)
True
False


X/False
=>
ZeroDevisionError

感谢您的快速回复!您将如何将其合并?像这样的?如果len(工作文件)>.20为真: