-
Notifications
You must be signed in to change notification settings - Fork 1
return GSPGroup while reverse-geocoding to GSP
#62
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -278,6 +278,9 @@ def reverse_geocode( | |
| ) | ||
| joined.update(nearest, overwrite=False) | ||
| joined["region_id"] = joined["region_id"].where(pd.notna(joined["region_id"]), None) | ||
| if "GSPGroup" in joined.columns: | ||
| joined["GSPGroup"] = joined["GSPGroup"].replace({pd.NA: None}) | ||
| return list(zip(joined["region_id"], joined["GSPGroup"])) | ||
| return joined["region_id"].tolist() | ||
|
Comment on lines
+283
to
284
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think its desirable to sometime return a list of strings and other times to return a list of tuples. I think we should always return a list of tuples, or else introduce a parameter to determine whether to return the GSPGroup or not (though the latter smells a little)
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since llsoa and nuts doesn't need to return a list of tuples, I think we should come up with something else. Is it okay to make a separate function for reverse geo-coding gsp? |
||
|
|
||
|
|
||
|
|
||
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.
Not sure what the if condition is for? won't this always evaluate to True?
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.
This won't be True when reverse geo-coding llsoa and nuts