pyspark.pandas.Index.astype¶
-
索引。
astype
( dtype:联盟(str,类型,numpy.dtype,pandas.core.dtypes.base.ExtensionDtype] )→IndexOpsLike¶ -
把指定dtype pandas-on-Spark对象
dtype
。- 参数
-
- dtype 数据类型
-
使用numpy。dtypeor Python type to cast entire pandas object to the same type.
- 返回
-
- 在同一 相同类型作为调用者
另请参阅
-
to_datetime
-
将参数转换为日期时间。
例子
> > >爵士=ps。系列([1,2),dtype=“int32”)> > >爵士0 11 2dtype: int32
> > >爵士。astype(“int64”)0 11 2dtype: int64
> > >爵士。重命名(“一个”)。to_frame()。set_index(“一个”)。指数。astype(“int64”)Int64Index ([1,2], dtype = int64, name = ' a ')