-
Notifications
You must be signed in to change notification settings - Fork 1
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
bug-fixes-for-710 #166
bug-fixes-for-710 #166
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work :) Just a couple of comments, I don't think there is anything that needs to be changed. But if you wanted to have look at something, it might be the iterating over rows
@@ -263,28 +263,44 @@ def load_and_join_finalsel( | |||
return df.merge(finalsel_data, on=["reference", "period"], how="left") | |||
|
|||
|
|||
def validate_nil_markers(df: pd.DataFrame, logger: logging.Logger) -> pd.DataFrame: | |||
def validate_nil_markers( | |||
cp_df: pd.DataFrame, qv_df: pd.DataFrame, logger: logging.Logger |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if a logger needs to be passed as an argument into every function. This is fine for now, but might be worth looking into when we have more time :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really nice work Luke, Like the solution to filter first and then iterate over it. Should speed things up in the cases of large data frames
|
||
return df | ||
condition = (qv_cp_df["response_type"] >= 4) & (qv_cp_df["adjusted_value"] != 0) | ||
filtered_qv_df = qv_cp_df[condition] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really like the new method to create a subset and only iterate over rows which meet this condition! Nice use of not resetting the index in filtered df as this will match unfiltered
|
||
validated_qv_df = qv_cp_df.drop(columns=["response_type"]) | ||
|
||
return validated_qv_df |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for renaming, makes it easier to track which dataframe is which :)
Pull Request Title
Summary
Add your summary here - keep it brief, to the point, and in plain English.
Type of Change
Checklists
This pull request meets the following requirements:
Creator Checklist
If you feel some of these conditions do not apply for this pull request, please
add a comment to explain why.
Reviewer Checklist
Additional Information
Please provide any additional information or context that would help the reviewer understand the changes in this pull request.
Related Issues
Link any related issues or pull requests here.