python - Pandas 中的 dtype ('O' ) 是什么?

标签 python pandas numpy dataframe types

我在 pandas 中有一个数据框,我正在尝试找出它的值的类型。我不确定列 'Test' 的类型是什么。但是,当我运行 myFrame['Test'].dtype 时,我得到了;

dtype('O')

这是什么意思?

最佳答案

意思是:

'O'     (Python) objects

Source .

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.

关于python - Pandas 中的 dtype ('O' ) 是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37561991/

相关文章:

python - 从不同的数组和数组/numpy 模块生成数组?

python - 从拟合分布中抽取

Python:使用拉丁字符对 URL 进行 URL 编码

python - Pandas Dataframe 条形图 - 定性变量?

python - Python中C类型整数的最大值和最小值

python - 如何使用 cdist 或 tensorflow 加速最近点比较?

python - 在Python pandas DataFrame中对具有接近日期时间的记录进行分组

python - python中数学函数的优化和加速

python - 给定不连续出现的索引列表,替换所有出现的 s 的子字符串 t 的 pythonic 方法是什么?

python - 将 Pandas DataFrame 转换为适合 django 模板的列表