Pandas is doing something weird with dtypes
here and I am trying to figure out why...
Here is an example pd.DataFrame
.
df = pd.DataFrame([[1, 2, 3], [1.1, 2.2, 3.3]]).T.convert_dtypes()
It's df.dtypes
are:
0 Int64
1 float64
dtype: object
I need to verify if the columns are the correct datatypes, so I do the following:
df[1].dtype == float
I get True
. When I do this for the 0
(int
) column:
df[0].dtype == int
I get False
The only way to "verify" the int
type it seems to be if I do this: df[0].dtype == pd.core.arrays.integer.Int64Dtype()
Question: Why the inconsistency?