Skip to content

Column Names get Mangled for Dam Headwater / Tailwater Stage Observations #177

Description

@MickeyRush

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions