2023-7-14 myluzh
Python
0x01 数组索引与切片用法
import numpy as np
# (2)二维数组
# 首先生成一个二维数组
arr2 = np.random.uniform(-1, 2, size=(5, 5))
"""
# 查看下arr2
arr2 Out[3]:
array([[ 1.05865188, 1.18597622, -0.81279676, 1.79444952, 0.71910054],
[-0.62385763, -0.61713265, 0.94918552, -0.24394799, 1.81343914],
[-0.71354709, -0.93964984, 0.96237785, 1.23973639, 0.11628672],
[ 0.02623292, 1.68481857, -0.79207649, 0.79625302, -0.32104851],
[ 0.75240426, 0.15582726, -0.87529045, -0.28858853, 0.01173709]])
# 只要...
阅读全文>>
标签: python numpy 数组
评论(0)
(445)