justetf-scraping
justetf-scraping copied to clipboard
Update deprecated code
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.
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.
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().