python学习笔记

python的数据类型

2020-11-22  本文已影响0人  三叠纪的小黑猫

1、python中有6种标准数据类型:number(数字),string (字符串),list (列表),tuple(元组),set (集合),dictionary (字典)。


2、type(),dtype(),astype()的区别。

用numpy读入数据,默认的dtype是‘float64’,要转变numpy中数据的类型,不能直接改变原数据的dtype,只能用astype()。

float类型包括‘float64’,‘float32’和‘float16’,默认为'float64'。

int 类型包括‘int64’,‘int32’,‘int16’和‘int8’,默认为‘int64’。

上一篇 下一篇

猜你喜欢

热点阅读