From 1e0560abdf21a1d85676ed53e068c17643c23c2c Mon Sep 17 00:00:00 2001 From: Jem Stachelek Date: Sun, 10 Apr 2022 22:02:15 -0600 Subject: [PATCH] Fixes #39 * fix rdb column parsing * fix url typo --- dataretrieval/nwis.py | 3 ++- dataretrieval/waterwatch.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/dataretrieval/nwis.py b/dataretrieval/nwis.py index 3f75f22..c871289 100644 --- a/dataretrieval/nwis.py +++ b/dataretrieval/nwis.py @@ -712,7 +712,8 @@ def _read_rdb(rdb): else: break - fields = re.split("[,\t]", rdb.splitlines()[count]) + fields = re.split("[\t]", rdb.splitlines()[count]) + fields = [field.replace(",", "") for field in fields] dtypes = {'site_no': str, 'dec_long_va': float, 'dec_lat_va': float} df = pd.read_csv(StringIO(rdb), delimiter='\t', skiprows=count + 2, diff --git a/dataretrieval/waterwatch.py b/dataretrieval/waterwatch.py index a3410b4..d7c9485 100644 --- a/dataretrieval/waterwatch.py +++ b/dataretrieval/waterwatch.py @@ -41,7 +41,7 @@ def get_flood_stage(sites: List[str] = None, fmt: str= "DF") -> Union[pd.DataFra 07144101 None None None None 50057000 16 20 24 30 """ - res = requests.get(url + 'floodstage', params={"format": ResponseFormat}) + res = requests.get(waterwatch_url + 'floodstage', params={"format": ResponseFormat}) if res.ok: json_res = res.json()