这件事已经折磨了我一段时间了。。。。你知道吗
我有以下信息:
1. a 1-D array of longitudes
2. a 1-D array of latitudues
3. a 2-D array of some quantity (sized len(lat),len(long))
我要做的是根据纬度和经度范围得到数组的子集
我试过这样的方法
ii = find( (lon >= xlims[0]) & (lon <= xlims[1]) )
jj = find( (lat >= ylims[0]) & (lat <= ylims[1]) )
z=array[jj, ii]
ValueError: shape mismatch: objects cannot be broadcast to a single shape
I have tried this using a boolean approach
ii = ( (lon >= xlims[0]) & (lon <= xlims[1]) )
jj = ( (lat >= ylims[0]) & (lat <= ylims[1]) )
但得到同样的错误。你知道吗
我可能错过了一些微妙的东西。。。有什么想法吗?你知道吗
我不知道你的} 。首先让我们制作一些虚拟数据:
find
函数做什么,但是你可以使用^{这给了我(这个数据)
当我们把它输入
np.ix_
时,我们得到了一些可以用来索引的东西:所以呢
相关问题 更多 >
编程相关推荐