我正在尝试绘制风速和风向,但是有一个错误代码不断告诉我“序列太大;不能大于32”.这是我正在使用的代码:
N = 500
ws = np.array(u)
wd = np.array(v)
df = pd.DataFrame({'direction': [ws], 'speed': [wd]})
df
direction speed
0 [[-7.87291, -8.19969, -8.41213, -8.42775, -8.4... [[-3.68055, -4.07912, -4.07992, -3.55594, -3.2...
from windrose import plot_windrose
N = 500
ws = np.random.random(u) * 6
wd = np.random.random(v) * 360
df = pd.DataFrame({'speed': ws, 'direction': wd})
plot_windrose(df, kind='contour', bins=np.arange(0.01,8,1), cmap=cm.hot, lw=3)
ValueError Traceback (most recent call last)
in ()
1 from windrose import plot_windrose
2 N = 500
3 ws = np.random.random(u) * 6
4 wd = np.random.random(v) * 360
5 df = pd.DataFrame({'speed': ws, 'direction': wd})
mtrand.pyx in mtrand.RandomState.random_sample (numpy\random\mtrand\mtrand.c:10396)()
mtrand.pyx in mtrand.cont0_array (numpy\random\mtrand\mtrand.c:1865)()
ValueError: sequence too large; cannot be greater than 32
如何解决此问题并绘制U和V?谢谢.