SciCompMod / memilio

Modular spatio-temporal models for epidemic and pandemic simulations
https://scicompmod.github.io/memilio/
Apache License 2.0
55 stars 16 forks source link

Compatibility with new pandas versions #229

Closed annette-lutz closed 2 years ago

annette-lutz commented 2 years ago

There are several changes in pandas version 1.4.0 that lead to warnings or errors. The append() function for dataframes throws a deprecation warning (replace by the pandas.concat() function). Running the main() function in getVaccinationData.py causes the following AttributeError in the write_dataframe() function:

File "memilio/pycode/memilio-epidata/memilio/epidata/getVaccinationData.py", line 1129, in main() File "memilio/pycode/memilio-epidata/memilio/epidata/getVaccinationData.py", line 1124, in main get_vaccination_data(**arg_dict) File "memilio/pycode/memilio-epidata/memilio/epidata/getVaccinationData.py", line 810, in get_vaccination_data gd.write_dataframe(df_data_agevacc_county_cs, File "memilio/pycode/memilio-epidata/memilio/epidata/getDataIntoPandasDataFrame.py", line 325, in write_dataframe df.Date = df.Date.dt.strftime('%Y-%m-%d') File "virtual_env_corona/lib/python3.8/site-packages/pandas/core/generic.py", line 5583, in getattr return object.getattribute(self, name) File "virtual_env_corona/lib/python3.8/site-packages/pandas/core/accessor.py", line 182, in get accessor_obj = self._accessor(obj) File "virtual_env_corona/lib/python3.8/site-packages/pandas/core/indexes/accessors.py", line 509, in new raise AttributeError("Can only use .dt accessor with datetimelike values") AttributeError: Can only use .dt accessor with datetimelike values

The calls to write_dataframe() in getTestingData.py raise a similar error message.

annette-lutz commented 2 years ago

It seems to be a problem with the Date column but getRKIData and getDIVIData do not have this issue despite having a Date column.