# -*- coding: utf-8 -*-
"""
Python Version: 3.5
Created on Thu May 11 16:32:36 2017
E-mail: Eric2014_Lv@sjtu.edu.cn
@author: DidiLv
"""
import numpy as np
x = np.array([1,2])
print(x.dtype) #在python 3.5里面,整数减小了内存int32
y = np.array([[1.,3.], [3.,5.]])
print(y.dtype)
print(type(y)) #注意区分: y是一个类只是是numpy的array,
# dtype是指元素的类型:(data type:数据类型)
z = np.array([1,2], dtype = np.int64) # 可以给制定内存
print(z.dtype)
Python Numpy Tutorials: 数据类型
最新推荐文章于 2025-03-17 00:28:28 发布
