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

Warning about "-9.000" -> NaN method in pandas 2 #37

Open
zmoon opened this issue Jul 11, 2024 · 1 comment
Open

Warning about "-9.000" -> NaN method in pandas 2 #37

zmoon opened this issue Jul 11, 2024 · 1 comment

Comments

@zmoon
Copy link
Owner

zmoon commented Jul 11, 2024

uscrn/data.py:234: 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["crx_vn"] = df["crx_vn"].replace("-9.000", np.nan)
@zmoon
Copy link
Owner Author

zmoon commented Jul 12, 2024

Seems like explicitly casting to desired dtype after replace may be the solution. But better identify the files this is happening for (seems like it may just be a few of the early archive ones) and check.

If it's that all version numbers are missing for a certain file, we don't actually want float dtype in that case.

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