-
Jérome Perrin authored
pandas 3.0 changed default string storage to StringDtype and became strict about type coercion on column assignment via loc. Assigning a DatetimeArray to a loc-indexed column with StringDtype raises: Invalid value '<DatetimeArray>...' for dtype 'str' Use direct column assignment (df['col'] = ...) instead, which handles the type conversion correctly in all pandas versions.
3abec507