快速提问。我遇到错误,因为 “'latin-1'编解码器无法编码位置0-1中的字符:序号不在范围内(256)” ,当运行时numpy.loadtxt“加载到内容之下。enter image description here
下面的是Traceback
Traceback (most recent call last):
File "C:/Users/g/Documents/instance/main_foud.py", line 8, in <module>
a_raw = np.loadtxt('D:\personal\stock\量比\资金流向统计\各股\GG主力增仓0105.txt')
File "C:\Users\g\AppData\Local\Programs\Python\Python35-32\lib\site-packages\numpy\lib\npyio.py", line 943, in loadtxt
first_vals = split_line(first_line)
File "C:\Users\g\AppData\Local\Programs\Python\Python35-32\lib\site-packages\numpy\lib\npyio.py", line 919, in split_line
line = asbytes(line)
File "C:\Users\g\AppData\Local\Programs\Python\Python35-32\lib\site-packages\numpy\compat\py3k.py", line 35, in asbytes
return str(s).encode('latin1')
UnicodeEncodeError: 'latin-1' codec can't encode characters in position 0-1: ordinal not in range(256)
有人可以帮我弄清问题是什么?感谢您的回答!