Skip to content

tdfs4ds.utils.frames

tdfs4ds.utils.frames

Reading values out of pandas rows the same way on every pandas version.

pandas 3 stores text columns as StringDtype(na_value=nan). A row taken with iterrows() from a frame that mixes such a column with an object column holds NaN where the cell was None, and NaN is truthy: row.get(X) or "" returns nan and str() of it is the text "nan". A missing primary index read that way became a primary index column named nan (0.3.8.13).

is_missing

is_missing(value) -> bool

True for None, NaN, pandas NA and NaT.

text

text(value) -> str

The value as stripped text, "" when it is missing.