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

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

问题描述

我在 Pandas 中有一个数据框,我想弄清楚它的值的类型是什么.我不确定 'Test' 列的类型是什么.但是,当我运行 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 除外,它被解释为字符数.项目大小必须与现有类型相对应,否则将引发错误.支持的种类有到现有类型,否则将引发错误.支持的种类有:

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)

另一个answer有助于检查types.

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

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