Pandas does uppercase/ lowercase mean anything in dtypes?

Viewed 674

Float32 vs float32?

What is the purpose of uppercase vs lowercase dtypes in Pandas?

Uppercase seems more error prone: 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

1 Answers

Yes, see here for example.

pandas can represent integer data with possibly missing values using arrays.IntegerArray. This is an extension types implemented within pandas.

Or the string alias "Int64" (note the capital "I", to differentiate from NumPy’s 'int64' dtype:

Capitalized types are pandas types, while uncapitalized types are numpy types.

One feature of pandas types is the ability to support nan, which is not a standard IEEE for non floats.

Related