DOI-USGS / DOI-USGS/dataretrieval-python
Column Names get Mangled for Dam Headwater / Tailwater Stage Observations
- Lingua principale
- Python
- Stelle
- 265
- Fork
- 63
- Merge medio
- 1g 20h
- PR unite (30g)
- 19
Descrizione
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
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Inizia eseguendo l’esempio get_record() dell’issue per i due numeri di sito elencati e il parametro 00065, quindi traccia il modo in cui vengono costruiti i nomi delle colonne delle osservazioni. La correzione è completata quando le colonne headwater e tailwater hanno nomi coerenti e utilizzabili, senza parentesi quadre o caratteri di virgolette estranei, e le intestazioni CSV riportate rimangono corrette.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- python
- Ambito
- api, data
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 48/100