import numpy as npx = np.array([[1,2,5],[2,3,5],[3,4,5],[2,3,6]])# 输出数组的行和列数print x.shape # (4, 3)# 只输出行数print x.shape[0] # 4# 只输出列数print x.shape[1] # 3
本文共 153 字,大约阅读时间需要 1 分钟。
import numpy as npx = np.array([[1,2,5],[2,3,5],[3,4,5],[2,3,6]])# 输出数组的行和列数print x.shape # (4, 3)# 只输出行数print x.shape[0] # 4# 只输出列数print x.shape[1] # 3
转载地址:http://bmlhl.baihongyu.com/