pandas 中的dtype('O')是什么? [英] What is dtype('O'), in pandas?

查看:119
本文介绍了 pandas 中的dtype('O')是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在熊猫中有一个数据框,我正在尝试弄清其值的类型。我不确定测试 列的类型。但是,当我运行 myFrame ['Test']。dtype 时,我得到了;

I have a dataframe in pandas and I'm trying to figure out what the types of its values are. I am unsure what the type is of column 'Test'. However, when I run myFrame['Test'].dtype, I get;

dtype('O')

这是什么意思?

推荐答案

这意味着:

'O'     (Python) objects


第一个字符指定数据的类型,其余字符指定每个项目的字节数,Unicode除外,Unicode将其解释为字符数。项目大小必须与现有类型相对应,否则将引发错误。支持的类型是现有类型的
,否则将引发错误。受支持的种类为:

The first character specifies the kind of data and the remaining characters specify the number of bytes per item, except for Unicode, where it is interpreted as the number of characters. The item size must correspond to an existing type, or an error will be raised. The supported kinds are to an existing type, or an error will be raised. The supported kinds are:



'b'       boolean
'i'       (signed) integer
'u'       unsigned integer
'f'       floating-point
'c'       complex-floating point
'O'       (Python) objects
'S', 'a'  (byte-)string
'U'       Unicode
'V'       raw data (void)

另一个答案,如果需要检查 type s。

Another answer helps if need check types.

这篇关于 pandas 中的dtype('O')是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆