-
Notifications
You must be signed in to change notification settings - Fork 47
Closed
Labels
python api feedbackFeedback for the Python Client APIFeedback for the Python Client API
Description
This code snippet should reproduce the error:
df = pd.DataFrame({'container': ['geoId/13']})
df['city'] = dc.get_places_in(df['container'], 'City')
df = dc.flatten_frame(df)
props = {'healthOutcome': "CDC_BPHigh"}
df['pops'] = dc.get_populations(df['city'], 'Person', props)
df['pops'].replace('', np.nan, inplace=True)
df.dropna(inplace=True)
df['bpHigh'] = dc.get_observations(df['pops'], 'prevalence', 'measuredValue', '2015', measurement_method='CDC_AgeAdjustedPrevalence')
df
Note a bunch of NaN's, where we expect data from each population. The fix seems to be:
test = df.reset_index(drop=True)
test['bpHigh'] = dc.get_observations(test['pops'], 'prevalence', 'measuredValue', '2015', measurement_method='CDC_AgeAdjustedPrevalence')
test
Here's a notebook with the code
https://colab.research.google.com/drive/1sSLtLmI_jo5T7poNlydY0QWghHerZMpj
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
python api feedbackFeedback for the Python Client APIFeedback for the Python Client API