Open smmaurer opened 3 years ago
In Pandas 1.2+, pandas.Index.to_native_types() is deprecated, raising warnings like the following:
pandas.Index.to_native_types()
This comes up in code that serializes data to yaml for storage and later reloading.
urbansim/utils/yamlio.py#L48
The replacement suggested in the message doesn't sound as general-purpose, but maybe it would work if Pandas is able to convert string representations of ints and floats back to the appropriate data type. Another option could be to use to_json().
to_json()
pandas.Index.to_native_types() pandas.Series.astype() pandas.Series.to_json()
I can confirm this is definitively broken with Pandas 2.0.0. The workaround is to replace pandas.Index.to_native_types() with pandas.Index.format()
pandas.Index.format()
In Pandas 1.2+,
pandas.Index.to_native_types()
is deprecated, raising warnings like the following:This comes up in code that serializes data to yaml for storage and later reloading.
urbansim/utils/yamlio.py#L48
The replacement suggested in the message doesn't sound as general-purpose, but maybe it would work if Pandas is able to convert string representations of ints and floats back to the appropriate data type. Another option could be to use
to_json()
.pandas.Index.to_native_types() pandas.Series.astype() pandas.Series.to_json()