class_docstr: Does simple seasonality _calculations on data.
  
      
class_docstr_tok: ["Does","simple","seasonality","_calculations","on","data","."]
code: def monthly_seasonality(
      self, data_frame, cum=True, add_average=False, price_index=False
  ):
      calculations = Calculations()
  
      if price_index:
          data_frame = data_frame.resample(
              "BM"
          ).mean()  # resample into month end
          data_frame = calculations.calculate_returns(data_frame)
  
      data_frame.index = pandas.to_datetime(data_frame.index)
  
      monthly_seasonality = calculations.average_by_month(data_frame)
  
      if add_average:
          monthly_seasonality["Avg"] = monthly_seasonality.mean(axis=1)
  
      if cum is True:
          monthly_seasonality.loc[0] = numpy.zeros(
              len(monthly_seasonality.columns)
          )
          monthly_seasonality = monthly_seasonality.sort_index()
  
          monthly_seasonality = calculations.create_mult_index(
              monthly_seasonality
          )
  
      return monthly_seasonality
  
file_path: finmarketpy/finmarketpy/economics/seasonality.py
imports: import numpy
  import pandas
  from findatapy.timeseries import Calculations, Filter
  from findatapy.util.commonman import CommonMan
  from findatapy.util.configmanager import ConfigManager
  from findatapy.util.loggermanager import LoggerManager
label_desc: Use image node_id 6 for calling the Seasonality obj's underlying member method code with example usage: obj.monthly_seasonality(data_frame, cum, add_average, price_index) and returns: monthly_seasonality