1、python中有6种标准数据类型:number(数字),string (字符串),list (列表),tuple(元组),set (集合),dictionary (字典)。
![](https://img.haomeiwen.com/i14658004/e2d18e03d7e13c95.jpg)
2、type(),dtype(),astype()的区别。
![](https://img.haomeiwen.com/i14658004/8b8cab9dad0945af.jpg)
用numpy读入数据,默认的dtype是‘float64’,要转变numpy中数据的类型,不能直接改变原数据的dtype,只能用astype()。
float类型包括‘float64’,‘float32’和‘float16’,默认为'float64'。
int 类型包括‘int64’,‘int32’,‘int16’和‘int8’,默认为‘int64’。
网友评论