用eval转换为字符串时报错:
File "test.py", line 43, in d1 data = eval(infile.readline()) File "<string>", line 1, in <module> NameError: name 'nan' is not defined
解决:
globals = { 'nan': 0 } # ----------- data = eval(infile.readline(), globals)
用eval转换为字符串时报错:
File "test.py", line 43, in d1 data = eval(infile.readline()) File "<string>", line 1, in <module> NameError: name 'nan' is not defined
解决:
globals = { 'nan': 0 } # ----------- data = eval(infile.readline(), globals)