更改python数据表中列的类型

2024-10-02 10:30:57 发布

您现在位置:Python中文网/ 问答频道 /正文

在pythondatatable中是否可以将stypes.int8更改为stypes.int32


Tags: int8int32pythondatatablestypes
2条回答

^{}开始:

As the name suggests, the package is closely related to R's data.table and attempts to mimic its core algorithms and API.

因此,您可以按照^{}^{}进行数据类型转换

您可以轻松做到:

假设您有一个DT,字段类型为int32

DT = dt.Frame({'x': [1,2,3,4,5]})

我们可以将其类型从int32更改为int8,如下所示

DT['x'] = dt.int8

以下是语法:

DT['column'] = datatype  # (dt.int32 or dt.str32 etc etcc)

相关问题 更多 >

    热门问题