Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Got FutureWarning #6

Open
jouss3ph opened this issue Jun 20, 2021 · 1 comment
Open

Got FutureWarning #6

jouss3ph opened this issue Jun 20, 2021 · 1 comment

Comments

@jouss3ph
Copy link

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
Copy link
Author

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant