python的数据类型

作者: 三叠纪的小黑猫 | 来源:发表于2020-11-22 11:05 被阅读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’。

相关文章

网友评论

    本文标题:python的数据类型

    本文链接:https://www.haomeiwen.com/subject/lshuiktx.html