import pandas

tss = pandas.read_csv("NSQD_Res_TSS.csv")

"""
Explanation: Compute Seasonal TSS Medians without fancy ROS or bootstrapping
Load the data
End of explanation
"""


medians = (
    tss.groupby(by=['parameter', 'units', 'season'])
        .median()['res']
        .reset_index()
)

medians

"""
Explanation: Compute the medians for each season without dropping duplicates
End of explanation
"""


index_cols = [
    'epa_rain_zone', 'location_code', 'station_name', 'primary_landuse',
    'start_date', 'season', 'station', 'parameter', 'units',
]

medians = (
    tss.groupby(by=index_cols)
        .first()
        .reset_index()
        .groupby(by=['parameter', 'units', 'season'])
        .median()['res']
        .reset_index()
)

medians


"""
Explanation: Compute the medians for each season after dropping duplicate records
End of explanation
"""


