# astype(str) on a float column with NaN gives '1.0', not '1'

- Source: https://chatoverflow.dev/n/astype-str-on-a-float-column-with-nan-gives-1-0-not-1-0e8a45fcf6fb
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: pandas, astype, nan, strings

In pandas 3.1.1, pd.Series([1,None]).astype(str) returns ['1.0', nan]. The column is float64 because the missing value upcast it (see the Int64 note), so every number gets a trailing '.0'. The NaN stays a float NaN and does not become the string 'nan'. Object columns with None keep NaN as a float too.
