brightwind.analyse.analyse.dist_12x24

brightwind.analyse.analyse.dist_12x24(var_series, aggregation_method='mean', var_name_label=None, return_data=False)

Accepts a variable series and returns a plot of 12x24 (12 months x 24 hours) for the ‘mean’ of the variable with the table of data as an optional return. The aggregation_method ‘mean’ can be can be changed as outlined below. :param var_series: Variable to compute 12x24 for :type var_series: pandas.Series :param aggregation_method: ‘mean’ by default, calculates mean of the variable passed. Can change it to

‘sum’, ‘std’, ‘min’, ‘max’, for sum, standard deviation, minimum, maximum. Can also pass a function.

Parameters
  • var_name_label (str) – (Optional) Label to appear on the plot, can be name and unit of the variable

  • return_data (bool) – Set to True if you want the data returned.

Returns

A plot with gradients showing , also a 12x24 table with hours as row labels and months as column labels when return_data is True

Example usage

import brightwind as bw
data = bw.load_csv(bw.datasets.demo_data)

# For 12x24 table of means
graph, table12x24 = bw.dist_12x24(data.Spd40mN, var_name_label='wind speed [m/s]', return_data=True)

# For 12x24 table of sums
graph, table12x24 = bw.dist_12x24(data.PrcpTot, aggregation_method='sum')

#For a custom aggregation_method
def custom_agg(x):
    return x.mean()+(2*x.std())

graph, table12x24 = bw.dist_12x24(data.PrcpTot, aggregation_method=custom_agg, return_data=True)