lisphilar / covid19-sir

CovsirPhy: Python library for COVID-19 analysis with phase-dependent SIR-derived ODE models.
https://lisphilar.github.io/covid19-sir/
Apache License 2.0
109 stars 43 forks source link

[Bug] DeprecationWarning with choroplethmap #1350

Closed lisphilar closed 1 year ago

lisphilar commented 1 year ago

Checkbox

Summary

DeprecationWarning was raised with the following test. https://github.com/lisphilar/covid19-sir/actions/runs/4085052527/jobs/7042511013

Reproducible example script

import covsirphy as cs
print(cs.__version__)
 imgfile = 'input/test.jpg'

    def test_with_actual_data(imgfile):
        engineer = cs.DataEngineer()
        engineer.download(databases=["japan", "covid19dh", "owid"])
        all_df = engineer.all()
        layer_df = engineer.layer()
        assert_frame_equal(all_df, layer_df, check_dtype=False, check_categorical=False)
>       engineer.choropleth(geo=None, variable=cs.Term.C, filename=imgfile)

The current outputs

`DeprecationWarning: In a future version, `df.iloc[:, i] = newvals` will attempt to set the values inplace instead of always setting a new array. To retain the old behavior, use either `df[df.columns[i]] = newvals` or, if columns are non-unique, `df.isetitem(i, newvals)``

Expected outputs

No warnings

Environment

- CovsirPhy version: 3.0.0.dev8
- Python version: 3.10

Package manager (required if installation issue)

No response

Platform (required if installation issue)

No response

Additional Context

No response

lisphilar commented 1 year ago

Supress the warning, referencing https://github.com/geopandas/geopandas/pull/2645 and https://github.com/pandas-dev/pandas/issues/48673