【发布时间】:2021-01-05 13:41:15
【问题描述】:
Float32 与 float32?
Pandas 中大写和小写 dtype 的用途是什么?
大写似乎更容易出错:TypeError: object cannot be converted to a FloatingDtype。
dtype = {
'doom_float64': 'Float64'
, 'radiance_float32': 'Float32'
, 'temperature_float': 'float'
, 'moonday_int64': 'Int64'
, 'month_int32': 'Int32'
, 'color_uint8': 'UInt8'
, 'shape_int': 'int'
, 'weekday_object': 'object'
, 'hour_object': 'string'
, 'kingdom_category': 'category'
}
>>> df.dtypes
doom_float64 Float64
radiance_float32 Float32
temperature_float float64
weekday_object object
hour_object string
moonday_int64 Int64
month_int32 Int32
color_uint8 UInt8
shape_int int64
kingdom_category category
dtype: object
Pandas v1.2.0
【问题讨论】:
-
我不确定,但会不会是大写字母用于区分数据类型和 NumPy 的数据类型?