python里的astype是什么意思?

来源:百度知道 编辑:UC知道 时间:2024/06/14 09:28:32
我没有装numeric。不知道怎么装。哪位大侠一起解决下?

astype实现变量类型转换:

astype(type): returns a copy of the array converted to the specified type.
a = a.astype('Float64')
b = b.astype('Int32')

Python中与数据类型相关函数及属性有如下三个:type/dtype/astype。

type()    返回参数的数据类型    

dtype    返回数组中元素的数据类型    

astype()    对数据类型进行转换    

扩展资料

Python语言特点

1、由于Python语