Python使用eval强制转换字符串为字典时报错:File “<string>“, line 1, in <module> NameError: name ‘nan‘ is not defined
文本中保存的内容为:{ 'QQQ': [0.067, 0.167, 0.2, 0.033, 0.233, 0.267, 0.1, 0.133], 'TTT': [0.5, 0.375, 0.25, 0.3, 0.6, 0.333, 0.857, 0.636, 0.667, 0.556]} 用eval转换为字符串时报错:File "test.py", line 43, in d1 data = eval(infile.readline()) File