Column Names get Mangled for Dam Headwater / Tailwater Stage Observations
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 48/100
Research direction
Start by running the get_record() example from the issue for the two listed site numbers and parameter 00065, then trace how observation column names are built. The fix is done when headwater and tailwater columns have consistent, usable names without stray brackets or quote characters, and the reported CSV headers remain correct.
Written by the indexing model from the issue text.
Description
The column names assigned to the output of get_record() come out with a mess of quotes and brackets, for dam headwater and tailwater stage observations.
sns = [
'03612600', # Ohio River at Olmsted Dam
'03399800', # Ohio River at Smithland Dam
]
start_date = '2014-10-01'
end_date = '2023-09-30'
param_code = '00065'
for sn in sns:
df = nwis.get_record(sn, start_date, end_date, parameterCd=param_code)
print(df.columns)
Index(['site_no', '00065_headwater, [headwater',
'00065_headwater, [headwater_cd', '00065_tailwater',
'00065_tailwater_cd'],
dtype='object')
Index(['site_no', '00065_headwater', '00065_headwater_cd',
'00065_stage - tailwater, [tailwater',
'00065_stage - tailwater, [tailwater_cd'],
dtype='object')
When written to a csv:
datetime,site_no,00065_headwater,00065_headwater_cd,"00065_stage - tailwater, [tailwater","00065_stage - tailwater, [tailwater_cd"
2014-10-01 05:00:00+00:00,03399800,13.66,A,12.12,A
2014-10-01 05:15:00+00:00,03399800,13.66,A,12.07,A
2014-10-01 05:30:00+00:00,03399800,13.66,A,12.11,A
2014-10-01 05:45:00+00:00,03399800,13.66,A,12.15,A
- Dominant language
- Python
- Stars
- 266
- Forks
- 63
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 19
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from DOI-USGS/dataretrieval-python
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
DOI-USGS/dataretrieval-python#421 · 1 reaction ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
DOI-USGS/dataretrieval-python#415 · 1 comment · 1 reaction ·
-
ready-for-agent
Difficulty 4/5 3-5 days Newbie friendliness 42/100
DOI-USGS/dataretrieval-python#413 ·
-
ready-for-agent
Difficulty 3/5 1-2 days Newbie friendliness 68/100
DOI-USGS/dataretrieval-python#410 ·
-
ready-for-agent
Difficulty 3/5 1-2 days Newbie friendliness 72/100
DOI-USGS/dataretrieval-python#412 ·
All issues in DOI-USGS/dataretrieval-python
Similar issues
-
documentation help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
simonw/sqlite-utils#872 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100