alvarobartt / covid-daily

🦠 COVID-19 Daily Data from Worldometers with Python
https://covid_daily.readthedocs.io
MIT License
13 stars 6 forks source link

Got FutureWarning #6

Open jouss3ph opened 3 years ago

jouss3ph commented 3 years ago

I believe that python will change the default value for some functions, here is the warning I got. Thanks

c:\program files\python37\lib\site-packages\covid_daily\covid.py:85: FutureWarning: The default value of regex will change from True to False in a future version. In addition, single character regular expressions willnot be treated as literal strings when regex=True. data[col] = data[col].str.replace('+', '').str.replace(',', '').astype(float).astype(int)

jouss3ph commented 3 years ago

it is on str.replace function, and the default regex value will be changed on future python releases to false. So here is the solution: data[col] = data[col].str.replace('+', '', regex=True).str.replace(',', '', regex=True).astype(float).astype(int)