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
Recently ran into an error when running the following code for site 02469675 (it isn't currently maintained):
import dataretrieval
test = dataretrieval.nwis.get_stats(sites='02469675')
.....
fields = re.split('[\t]', rdb.splitlines()[count]) # points to this as being the issue
fields = [field.replace(',', '') for field in fields]
dtypes = {
'site_no': str,
'dec_long_va': float,
(...)
'parameter_cd': str,
}
IndexError: list index out of range
I might handle this case specifically by searching for "No sites found" within the response. But I would also catch more general errors of this type by printing the full response in the error message.
Recently ran into an error when running the following code for site 02469675 (it isn't currently maintained):
This is because the link (https://waterservices.usgs.gov/nwis/stat/?sites=02469675) returns the following:
I think we should accommodate these potential responses.
The text was updated successfully, but these errors were encountered: