0
我想在一個相當大的數據集的Python中做一個hexbin圖。包含數據的兩個數組長度爲3500萬條。但是,它們只佔用1.5 GB的內存,並且我有超過4 GB的可用內存。 Hexbin失敗並出現內存錯誤。Matplotlib hexbin內存錯誤
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug
Traceback (most recent call last):
File "plotmodel.py", line 20, in <module>
plt.hexbin(d,t,m, bins='log', gridsize=20, xscale='log', lw=1, edgecolors='black', alpha=0.8, cmap=plt.cm.jet)
File "/Library/Frameworks/Python.framework/Versions/7.1/lib/python2.7/site-packages/matplotlib/pyplot.py", line 2142, in hexbin
ret = ax.hexbin(x, y, C, gridsize, bins, xscale, yscale, extent, cmap, norm, vmin, vmax, alpha, linewidths, edgecolors, reduce_C_function, mincnt, marginals, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/7.1/lib/python2.7/site-packages/matplotlib/axes.py", line 6035, in hexbin
iy2 = np.floor(y).astype(int)
MemoryError
在什麼情況hexbin不會對大數據集工作,或者是錯誤由於硬件限制,任何根本原因是什麼?