- 2026年07月08日
- 星期三
参见英文答案 Understanding Python’s slice notation30个 a=0123456789 a0123456789 a[1:-6:1] # working as expected123 a[2:-1:-1] # i was expecting
我正在使用多维Numpy数组.我注意到在使用其他索引数组访问这些数组时会出现一些不一致的行为.例如: import numpy as npstart = np.zeros((7,5,3))a = start[:,:,np.arange(2)]b = start[0,:,np.arange(2)]c = start[0,:,:2]print a:, a.shap
