monthly_std_dev¶
-
hydrostats.data.
monthly_std_dev
(merged_data)¶ Calculates monthly seasonal standard deviation of the timeseries data in a DataFrame
Parameters: merged_data (DataFrame) – A pandas DataFrame with a datetime index and columns containing float type values. Returns: A pandas dataframe with a string type index of date representations and the monthly seasonal standard deviation as float values in the columns. Return type: DataFrame Examples
>>> import hydrostats.data as hd >>> import pandas as pd >>> pd.options.display.max_rows = 15
The data URLs contain streamflow data from two different models, and are provided from the Hydrostats Github page
>>> sfpt_url = r'https://github.com/waderoberts123/Hydrostats/raw/master/Sample_data/sfpt_data/magdalena-calamar_interim_data.csv' >>> glofas_url = r'https://github.com/waderoberts123/Hydrostats/raw/master/Sample_data/GLOFAS_Data/magdalena-calamar_ECMWF_data.csv' >>> merged_df = hd.merge_data(sfpt_url, glofas_url, column_names=('Streamflow Prediction Tool', 'GLOFAS'))
>>> hd.monthly_std_dev(merged_df) Streamflow Prediction Tool GLOFAS 01 2483.087791 2346.587412 02 2049.872689 1834.931830 03 2762.489873 2401.929369 04 4251.358318 4001.410267 05 5458.296296 4597.889041 06 4858.578846 4410.784791 07 4494.550854 3802.392524 08 4261.406429 3626.662349 09 4645.650733 4011.522281 10 4410.965472 3755.362766 11 4760.001179 3773.190543 12 4449.865762 3885.481991