code: def weekly_plots(
      df,
      variable,
      renormalize = True,
      plot        = True,
      scatter     = False,
      linestyle   = "-",
      linewidth   = 1,
      s           = 1
      ):
      
      if not "days_through_week" in df.columns:
          log.error("field days_through_week not found in DataFrame")
          return False
      weeks = []
      for group in df.groupby(df.index.week):
          weeks.append(group[1])
      scaler = MinMaxScaler()
      plt.ylabel(variable);
      for week in weeks:
          if renormalize:
              values = scaler.fit_transform(week[[variable]])
          else:
              values = week[variable]
          if plot:
              plt.plot(week["days_through_week"], values, linestyle = linestyle, linewidth = linewidth)
          if scatter:
              plt.scatter(week["days_through_week"], values, s = s)
      plt.xticks(
          [     0.5,       1.5,         2.5,        3.5,      4.5,        5.5,      6.5],
          ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"]
      )
docs: Create weekly plots of a variable in a DataFrame, optionally renormalized.
      It is assumed that the variable `days_through_week` exists.