class_docstr: Returns datasets included in the library in `pandas.DataFrame` format.
  
  Attributes
  ----------
  available_datasets : `list` [`str`]
      The names of the available datasets.
class_docstr_tok: ["Returns","datasets","included","in","the","library","in","`","pandas.DataFrame","`","format",".","Attributes","--","--","--","--","--","available_datasets",":","`","list","`","[","`","str","`","]","The","names","of","the","available","datasets","."]
docstr: Returns aggregated data.
  
  Parameters
  ----------
  df : `pandas.DataFrame`.
      The input data must have TIME_COL ("ts") column and the columns in the keys of ``agg_func``.
  
  agg_freq : `str` or None, default None
      If None, data will not be aggregated and will include all columns.
      Possible values: "hourly", "daily", "weekly", or "monthly".
  
  agg_func : `Dict` [`str`, `str`], default None
      A dictionary of the columns to be aggregated and the corresponding aggregating functions.
      Possible aggregating functions include "sum", "mean", "median", "max", "min", etc.
      An example input can be {"col1":"mean", "col2":"sum"}
      If None, data will not be aggregated and will include all columns.
  
  Returns
  -------
  df : `pandas.DataFrame`
      The aggregated dataframe.
docstr_tok: ["Returns","aggregated","data",".","Parameters","--","--","--","--","--","df",":","`","pandas.DataFrame","`",".","The","input","data","must","have","TIME_COL","(","``","ts","''",")","column","and","the","columns","in","the","keys","of","``","agg_func","``",".","agg_freq",":","`","str","`","or","None",",","default","None","If","None",",","data","will","not","be","aggregated","and","will","include","all","columns",".","Possible","values",":","``","hourly","''",",","``","daily","''",",","``","weekly","''",",","or","``","monthly","''",".","agg_func",":","`","Dict","`","[","`","str","`",",","`","str","`","]",",","default","None","A","dictionary","of","the","columns","to","be","aggregated","and","the","corresponding","aggregating","functions",".","Possible","aggregating","functions","include","``","sum","''",",","``","mean","''",",","``","median","''",",","``","max","''",",","``","min","''",",","etc",".","An","example","input","can","be","{","``","col1","''",":","''","mean","''",",","``","col2","''",":","''","sum","''","}","If","None",",","data","will","not","be","aggregated","and","will","include","all","columns",".","Returns","--","--","--","-","df",":","`","pandas.DataFrame","`","The","aggregated","dataframe","."]
code: def get_aggregated_data(df, agg_freq=None, agg_func=None):
      """Returns aggregated data.
  
      Parameters
      ----------
      df : `pandas.DataFrame`.
          The input data must have TIME_COL ("ts") column and the columns in the keys of ``agg_func``.
  
      agg_freq : `str` or None, default None
          If None, data will not be aggregated and will include all columns.
          Possible values: "hourly", "daily", "weekly", or "monthly".
  
      agg_func : `Dict` [`str`, `str`], default None
          A dictionary of the columns to be aggregated and the corresponding aggregating functions.
          Possible aggregating functions include "sum", "mean", "median", "max", "min", etc.
          An example input can be {"col1":"mean", "col2":"sum"}
          If None, data will not be aggregated and will include all columns.
  
      Returns
      -------
      df : `pandas.DataFrame`
          The aggregated dataframe.
      """
      if TIME_COL not in df.columns:
          raise ValueError(f"{TIME_COL} must be in the DataFrame.")
  
      if not agg_freq and not agg_func:
          return df
      elif agg_freq and agg_func:
          df_raw = df[list(agg_func.keys())]
          df_raw.insert(0, TIME_COL, pd.to_datetime(df[TIME_COL]))
          if agg_freq == "hourly":
              # Aggregate to hourly
              df_tmp = df_raw.resample("H", on=TIME_COL).agg(agg_func)
              df_hourly = (
                  df_tmp.drop(columns=TIME_COL).reset_index()
                  if TIME_COL in df_tmp.columns
                  else df_tmp.reset_index()
              )
              return df_hourly
          elif agg_freq == "daily":
              # Aggregate to daily
              df_tmp = df_raw.resample("D", on=TIME_COL).agg(agg_func)
              df_daily = (
                  df_tmp.drop(columns=TIME_COL).reset_index()
                  if TIME_COL in df_tmp.columns
                  else df_tmp.reset_index()
              )
              return df_daily
          elif agg_freq == "weekly":
              # Aggregate to weekly
              df_tmp = df_raw.resample("W-MON", on=TIME_COL).agg(
                  agg_func
              )
              df_weekly = (
                  df_tmp.drop(columns=TIME_COL).reset_index()
                  if TIME_COL in df_tmp.columns
                  else df_tmp.reset_index()
              )
              return df_weekly
          elif agg_freq == "monthly":
              # Aggregate to monthly
              df_tmp = df_raw.resample("MS", on=TIME_COL).agg(agg_func)
              df_monthly = (
                  df_tmp.drop(columns=TIME_COL).reset_index()
                  if TIME_COL in df_tmp.columns
                  else df_tmp.reset_index()
              )
              return df_monthly
          else:
              warnings.warn(
                  'Invalid "agg_freq", must be one of "hourly", "daily", "weekly" or "monthly". '
                  "Non-aggregated data is returned."
              )
              return df_raw
      else:
          warnings.warn(
              'Both "agg_freq" and "agg_func" must be provided. '
              "Non-aggregated data is returned."
          )
          return df
  
imports: import datetime
  import os
  import warnings
  from pathlib import Path
  import pandas
  from greykite.common.constants import TIME_COL
label_desc: Use image node_id 4 for calling the DataLoader obj's underlying member method code with example usage: obj.get_aggregated_data(df, agg_freq, agg_func) and returns: df, df, df_hourly, df_daily, df_weekly, df_monthly, df_raw