-
Notifications
You must be signed in to change notification settings - Fork 63
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
Rename geocode #1051
Rename geocode #1051
Conversation
Assignment to individual attributes to columns is now possible. No documented interface for this yet
I've renamed the df = gc.geocode(df, street='address', status={'fields':['relevance'], 'prefix'='gc_'})
print(df[df['gc_relevance']>0.7, axis=1)])
df = gc.geocode(df, street='address', status={'fields':['relevance'], 'prefix'=''}).data
print(df[df['relevance']>0.7, axis=1)]) The prefix has a default value of I think we could provide some shortcut options e.g. passing just an array (for field names): df = gc.geocode(df, street='address', status=['relevance']).data
print(df[df['carto_geocode_relevance']>0.7, axis=1)]) Another option would be, instead of using a prefix, assign column names to each field with a dict: df = gc.geocode(df, street='address', status={'gc_rel': 'relevance'})
print(df[df['gc_rel']>0.7, axis=1)]) cc @alasarr |
I really like your latest suggestion: df = gc.geocode(df, street='address', status={'gc_rel': 'relevance'})
print(df[df['gc_rel']>0.7, axis=1)]) But having a default config of status to
|
I'll follow @alasarr advice, so this is how this will look: # Default (equivalent to `status={'gc_status_rel': 'relevance'}`)
# produces columns `gc_status_rel` with geocoding relevance
df = gc.geocode(df, street='address')
# No status columns added
df = gc.geocode(df, street='address', status=None)
# Custom columns
df = gc.geocode(df, street='address', status={'gc_st_rel': 'relevance', 'gc_st_prec': 'precision'})
# Single JSON status column (with relevance, precision, match_types)
df = gc.geocode(df, street='address', status={'gc_status': 'metadata'}) Now, the name of the hash column is |
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.
LGTM! Just solve the conflict with docs/geocode.rst
.
Also, I have added a suggestion regarding error messages.
Some minor changes & doc updates for consistency with Isolines