感谢用户 Eduard Ilyasov 几天前帮助我
现在我得到了一些结果,但我几乎不明白这些
我试图计算从 1979 年到 2016 年的温度趋势。
#calculate trend
####numpy.ployfit
nmon = nyr * 12
tdum = MA.arange(0,nmon)
ntimes, ny, nx = tempF.shape
#ntimes is time, ny is latitude, nx is longitude
print tempF.shape
trend = MA.zeros((ny,nx), dtype='2f')
#trend = MA.zeros((ny,nx),dtype=float)
print trend.shape
for y in range (0,ny):
for x in range (0,nx):
trend[y,x]= numpy.polyfit(tdum, tempF[:,y,x],1)
print trend.shape
print trend
Run Code Online (Sandbox Code Playgroud)
这些是结果:
(
(456, 241, 480)
(241, 480, 2)
(241, 480, 2)
[[[ 0.00854342 -1.94362879]
[ 0.00854342 -1.94362879] …Run Code Online (Sandbox Code Playgroud)