justetf-scraping icon indicating copy to clipboard operation
justetf-scraping copied to clipboard

Update deprecated code

Open GabryDX opened this issue 1 year ago • 2 comments

When executing the command justetf_scraping.load_overview() I get:

FutureWarning: Downcasting behavior in `replace` is deprecated and will be removed in a future version. To retain the old behavior, explicitly call `result.infer_objects(copy=False)`. To opt-in to the future behavior, set `pd.set_option('future.no_silent_downcasting', True)`
  df[column] = df[column].replace({"Yes": True, "No": False}).astype("bool")

Everything works so it is not blocking, but needs to be addressed.

GabryDX avatar May 09 '24 11:05 GabryDX

Hi @GabryDX, is the warning still there? If yes, which version of Python and Pandas are you using? I wanted to fix this, but I don't get any warnings.

druzsan avatar Aug 05 '24 15:08 druzsan

The problem was that my Pandas version is too low (2.0.3) because of Python 3.8 support.

The warning itself is addressed e.g. here and the suggested solution is to disable the future warning pd.set_option('future.no_silent_downcasting', True) somewhere before justetf_scraping.load_overview().

druzsan avatar Aug 13 '24 07:08 druzsan