-
Notifications
You must be signed in to change notification settings - Fork 72
Open
Description
In mapping a pandas DataFrame's numeric fips index to state name, I currently have to do this:
state['state'] = pd.Series(state.index).apply(
lambda x: us.states.lookup(str(x).zfill(2)).name).tolist()
There are a couple things going on here that could be other issues*, but might also be nice to have the vectorization built-in for pandas. e.g. I'd like to be able to just do:
state['state'] = us.states.lookup(state.index)
* This one was verbose because things like us.states.lookup(1) and us.states.lookup('1') fail.
rchurt and fedderw
Metadata
Metadata
Assignees
Labels
No labels