You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following functions: get_qwdata, get_discharge_measurements, get_discharge_peaks, get_gwlevels, get_stats, get_dv, get_info, get_iv will output a dataframe with a datetime index when a single site is provided and a dataframe with a MultiIndex (site/datetime) when more than 1 site is provided.
To Reproduce
Single site:
site_id = "434400121275801"
nwis.get_gwlevels(sites=site_id)
More than one site:
site_ids = ["434400121275801", "375907091432201"]
nwis.get_gwlevels(sites=site_ids)
Expected behavior
For consistency, both queries should return similar dataframes.
The text was updated successfully, but these errors were encountered:
cjbas22
changed the title
Makin
Functions output is inconsistent (different number of columns) when querying one/multiple sites.
Oct 3, 2022
This modification addresses issue #25 by adding an additional parameter multi_index to some functions. When multi_index=False the output will be a dataframe with a single-level index (datetime) independently of the number of sites being queried.
If a single site is provided the output is always a dataframe with a single level (datetime) Index. multi_index doesn't do anythign in this case as format_response checks "if len(df['site_no'].unique()) > 1" first.
Issue
The following functions: get_qwdata, get_discharge_measurements, get_discharge_peaks, get_gwlevels, get_stats, get_dv, get_info, get_iv will output a dataframe with a datetime index when a single site is provided and a dataframe with a MultiIndex (site/datetime) when more than 1 site is provided.
To Reproduce
Single site:
site_id = "434400121275801"
nwis.get_gwlevels(sites=site_id)
More than one site:
site_ids = ["434400121275801", "375907091432201"]
nwis.get_gwlevels(sites=site_ids)
Expected behavior
For consistency, both queries should return similar dataframes.
The text was updated successfully, but these errors were encountered: