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

warnings created while processing r7 on bastion #97

Open
sjnoone opened this issue Nov 25, 2024 · 0 comments
Open

warnings created while processing r7 on bastion #97

sjnoone opened this issue Nov 25, 2024 · 0 comments
Assignees

Comments

@sjnoone
Copy link
Contributor

sjnoone commented Nov 25, 2024

Here are some python version warnings created while processing r7 on bastion. Need to be addressed for r8.

/ichec/work/glamod/r.7/code/hourly_qff_to_cdm_utils.py:149: FutureWarning: Downcasting object dtype arrays on .fillna, .ffill, .bfill is deprecated and will change in a future version. Call result.infer_objects(copy=False) instead. To opt-in to the future behavior, set pd.set_option('future.no_silent_downcasting', True)
var_frame = var_frame.fillna("null")
/ichec/work/glamod/r.7/code/hourly_qff_to_cdm_utils.py:113: FutureWarning: ChainedAssignmentError: behaviour will change in pandas 3.0!
You are setting values through chained assignment. Currently this works in certain cases, but when using Copy-on-Write (which will become the default behaviour in pandas 3.0) this will never work to update the original DataFrame or Series, because the intermediate object on which we are setting values will behave as a copy.
A typical example is when you are setting values in a column of a DataFrame, like:

df["col"][row_indexer] = value

Use df.loc[row_indexer, "col"] = values instead, to perform the assignment in a single step and ensure this keeps updating the original df.

See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy

var_frame.quality_flag[var_frame.quality_flag == "Null"] = 0

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

2 participants