Python-Matplotlib2 Questions

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Python-Matplotlib2 Questions相关的知识,希望对你有一定的参考价值。

Question 1:

列中有中文

Traceback (most recent call last):
File "~/PycharmProjects/ltest/scripts/py_matlab.py", line 17, in <module>
ages, weights, heights = np.loadtxt(‘data.csv‘, delimiter=‘,‘ , skiprows=0 , unpack=True)
File "/opt/share/anaconda3/lib/python3.6/site-packages/numpy/lib/npyio.py", line 888, in loadtxt
first_vals = split_line(first_line)
File "/opt/share/anaconda3/lib/python3.6/site-packages/numpy/lib/npyio.py", line 864, in split_line
line = asbytes(line)
File "/opt/share/anaconda3/lib/python3.6/site-packages/numpy/compat/py3k.py", line 31, in asbytes
return str(s).encode(‘latin1‘)
UnicodeEncodeError: ‘latin-1‘ codec can‘t encode characters in position 0-1: ordinal not in range(256)

Resolve 1 :

http://blog.csdn.net/dgatiger/article/details/50414549










以上是关于Python-Matplotlib2 Questions的主要内容,如果未能解决你的问题,请参考以下文章

python-matplotlib学习

Python-Matplotlib 13 网格

Python-Matplotlib基础

python-matplotlib函数

Python-Matplotlib 14 图例legend

数字黑洞:python-matplotlib来实现可视化