2025年6月28日

numpy索引问题

摘要: numpy索引问题 1.传入为一个元素时 切片。 import numpy as np a = np.arange(12).reshape(3,4) >>>a[1:,2:] array([[ 6, 7], [10, 11]]) 数组。当查询数组是1维时,传入的索引是数组形状时,取出的值是与传入的数组 阅读全文

posted @ 2025-06-28 14:44 Devprayer 阅读(5) 评论(0) 推荐(0)

数组维度

摘要: Numpy的ndarray 数组维度 关于数组维度的一些问题 import numpy as np a = np.arange(24).reshape(2,3,4) a >>>array([[[ 0, 1, 2, 3], [ 4, 5, 6, 7], [ 8, 9, 10, 11]], [[12, 阅读全文

posted @ 2025-06-28 14:43 Devprayer 阅读(16) 评论(0) 推荐(0)

导航