Skip to content

Commit

Permalink
Added example to class
Browse files Browse the repository at this point in the history
  • Loading branch information
jbousquin committed Sep 12, 2023
1 parent 4736a97 commit 623522c
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions harmonize_wq/harmonize.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,31 @@ class WQCharData():
Examples
--------
Build dataframe to use as input:
>>> import pandas
>>> from numpy import nan
>>> df = pandas.DataFrame({'CharacteristicName': ['Phosphorus',
'Temperature, water',],
... 'ResultMeasure/MeasureUnitCode': [nan, nan],
... 'ResultMeasureValue': ['1.0', '10.0',],
... })
>>> df
CharacteristicName ResultMeasure/MeasureUnitCode ResultMeasureValue
0 Phosphorus NaN 1.0
1 Temperature, water NaN 10.0
>>> wq = harmonize.WQCharData(df, 'Phosphorus')
>>> wq.df
CharacteristicName ResultMeasure/MeasureUnitCode ... Units Phosphorus
0 Phosphorus NaN ... NaN 1.0
1 Temperature, water NaN ... NaN NaN
[2 rows x 5 columns]
>>> wq.df.columns
Index(['CharacteristicName', 'ResultMeasure/MeasureUnitCode',
'ResultMeasureValue', 'Units', 'Phosphorus'],
dtype='object')
"""

def __init__(self, df_in, char_val):
Expand Down

0 comments on commit 623522c

Please sign in to comment.