import numpy as np
index = range(0,10)
indexList = np.array_split(index,3) #指定array拆分个数
N=2 #按指定元素长度拆分array
indexList = [index[i:i+N] for i in range(0,len(index),N)]
import numpy as np
index = range(0,10)
indexList = np.array_split(index,3) #指定array拆分个数
N=2 #按指定元素长度拆分array
indexList = [index[i:i+N] for i in range(0,len(index),N)]
本文标题:np拆分array
本文链接:https://www.haomeiwen.com/subject/xhnosrtx.html
网友评论