A classic int64 column becomes float64 as soon as one value is missing, and 7 becomes 7.0. Nullable dtypes (capital-I Int64, boolean, string) keep integers exact and missing values explicit.
- Lesson: Override the pandas defaults that change your data
- Practise: Label unknown categories, keep missing numbers missing
Related: Missing value (null), Type inference