ndarray index in numpy
2016-10-15 16:30
288 查看
a = np.zeros((10,20,3), np.int) a.shape # (10,20,3) a[0][0].shape a[0, 0].shape # (3,) # (3,) a[0][0:5].shape a[0, 0:5].shape # (5,3) # (5,3) a[0:3][0:5].shape a[0:3, 0:5].shape # (3, 20, 3) # (3, 5, 3) a[0:1, 0:5].shape a[0, 0:5].shape # (1,20,3) # (20,3)
a[0:3][0:5] may get unexpected result. Use a[0:3, 0:5].
相关文章推荐
- AttributeError: 'numpy.ndarray' object has no attribute 'index'
- a_func_a_day_in_python_numpy.ndarray与mxnet.ndarray.NDArray的转换
- 关于AttributeError:'numpy.ndarray' object has no attribute 'index'
- Cannot initialize the indexer process in Index Management In Magento
- numpy.ndarray 如何转化为 list
- 基于【matplotlib】【imshow】【cmap】绘制【numpy.ndarray】二维数组的“二维码”
- numpy (1) ndarray
- IndexOutOfBoundsException: Inconsistency detected. Invalid view holder adapter notifyItemRangeRemove
- jQuery.inArray( value, array [, fromIndex ] )
- <Chapter 2>Fast Index Creation in the InnoDB Storage Engine
- Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 6
- 成功解决RecyclerView Bug:IndexOutOfBoundsException: Inconsistency detected. Invalid item position
- Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 1
- java.lang.IllegalArgumentException: Illegal character in query at index 55
- Index XXX or partition of such index is in unusable state
- Throwable:Invalid stub element type in index
- 解决java.lang.IndexOutOfBoundsException: Inconsistency detected. Invalid item position 1(offset:1)
- numpy中的ndarray方法和属性
- NumPy与ndarray简介
- ORA-01502: index ‘index_name' or partition of such index is in unusable state