2020-08-19
阅读量:
954
python 中的 type(), dtype(), astype()
函数 | 说明 |
type() | 返回数据结构类型(list、dict、numpy.ndarray 等) |
dtype() | 返回数据元素的数据类型(int、float等) 备注:1)由于 list、dict 等可以包含不同的数据类型,因此不可调用dtype()函数 2)np.array 中要求所有元素属于同一数据类型,因此可调用dtype()函数 |
astype() | 改变np.array中所有数据元素的数据类型。 备注:能用dtype() 才能用 astype() |






评论(0)


暂无数据