daily_std_dev¶
-
hydrostats.data.
daily_std_dev
(merged_data)¶ Calculates daily 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 daily 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.daily_std_dev(merged_df) Streamflow Prediction Tool GLOFAS 01/01 3349.139373 2969.748253 01/02 3273.308852 2617.851437 01/03 3165.117397 2556.319898 01/04 3043.888685 2501.999235 01/05 2894.662206 2436.603046 01/06 2741.049485 2372.487729 01/07 2612.931931 2341.011275 ... ... 12/25 3631.744428 3352.464257 12/26 3487.081980 3355.480036 12/27 3448.825041 3300.770870 12/28 3439.995086 3194.812751 12/29 3395.528078 3061.536706 12/30 3318.884936 2928.699478 12/31 3235.528520 2808.611992 [366 rows x 2 columns]