brightwind.analyse.analyse.monthly_means

brightwind.analyse.analyse.monthly_means(data, return_data=False, return_coverage=False, ylabel='Wind speed [m/s]')

Plots means for calendar months in a timeseries plot. Input can be a series or a DataFrame. Can also return data of monthly means with a plot.

Parameters
  • data (Series or DataFrame) – A timeseries to find monthly means of. Can have multiple columns

  • return_data (bool) – To return data of monthly means along with the plot.

  • return_coverage (bool) – To return monthly coverage along with the data and plot. Also plots the coverage on the same graph if only a single series was passed to data.

  • ylabel (str) – Label for the y-axis, Wind speed [m/s] by default

Returns

A plot of monthly means for the input data. If return data is true it returns a tuple where the first element is plot and second is data pertaining to monthly means.

Example usage

import brightwind as bw
data = bw.load_csv(bw.shell_flats_80m_csv)

monthly_means_plot, monthly_means = bw.monthly_means(data, return_data=True)
print("Monthly means data for all the columns:")
print(monthly_means)
print("Monthly means plot for all the columns:")
monthly_means_plot

# For a single column only
bw.monthly_means(data.WS80mWS425NW_Avg)

# Return coverage
monthly_means_plot, monthly_means = bw.monthly_means(data.WS80mWS425NW_Avg, return_coverage=True)
monthly_means_plot