座標列表我要繪製圖表使用的座標列表這樣的圖表:陰謀使用Python和多陣列錯誤
a = [<x1>, <y1>, <x2>, <y2>, …]
那就是我用的算法:
import matplotlib.pyplot as plt
import numpy as np
a = [<x1>, <y1>, <x2>, <y2>, ….]
x,y = np.array(a).reshape((len(a)/2, 2)).transpose()
plt.plot(x,y)
放我一個奇怪的錯誤失敗,根錯誤是:
ImportError: cannot import name multiarray
所以這裏有什麼問題。我必須改變我的算法,或者有不同的方式來繪製使用座標列表的圖形。
謝謝;
,這是整個堆棧跟蹤:
/usr/bin/python3.3 /cs/usr/mohammadja/grph/graph.py
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/numpy/core/__init__.py", line 16, in <module>
from . import multiarray
ImportError: cannot import name multiarray
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/cs/usr/mohammadja/grph/graph.py", line 1, in <module>
import matplotlib.pyplot as plt
File "/usr/lib/python3/dist-packages/matplotlib/__init__.py", line 122, in <module>
from matplotlib.cbook import is_string_like, mplDeprecation, dedent, get_label
File "/usr/lib/python3/dist-packages/matplotlib/cbook.py", line 32, in <module>
import numpy as np
File "/usr/lib/python3/dist-packages/numpy/__init__.py", line 142, in <module>
from . import add_newdocs
File "/usr/lib/python3/dist-packages/numpy/add_newdocs.py", line 13, in <module>
from numpy.lib import add_newdoc
File "/usr/lib/python3/dist-packages/numpy/lib/__init__.py", line 8, in <module>
from .type_check import *
File "/usr/lib/python3/dist-packages/numpy/lib/type_check.py", line 11, in <module>
import numpy.core.numeric as _nx
File "/usr/lib/python3/dist-packages/numpy/core/__init__.py", line 24, in <module>
raise ImportError(msg)
ImportError:
Importing the multiarray numpy extension module failed. Most
likely you are trying to import a failed build of numpy.
If you're working with a numpy git repo, try `git clean -xdf` (removes all
files not under version control). Otherwise reinstall numpy.
Process finished with exit code 1
可以粘貼整個堆棧跟蹤? –
我過去了...... –