def plot_df_line(df: pd.DataFrame,
                 title: str = 'Metric',
                 group_by: str = 'player',
                 xaxis: str = 'time',
                 yaxis: str = 'value_float',
                 ax: plt.Axes = None) -> None:
  """Plots a line chart of a dataframe.

  Args:
    df: The dataframe with data to plot.
    title: The title of the plot.
    group_by: Group data by this field, plot each one as a line in the figure.
    xaxis: The name of the column to use as the x-axis. If multiple entries have
      the same value in this field, the y-axis values are averaged.
    yaxis: The name of the column to use as the y-axis. The values in this
      column must be numerical.
    ax: The axis to plot on. If None, uses the current axis.
  """
  if ax is None:
    ax = plt.gca()

  for player, group_df in df.groupby(group_by):
    group_df = group_df.groupby(xaxis).mean(numeric_only=True).reset_index()
    group_df.plot(x=xaxis, y=yaxis, label=player, ax=ax)
  plt.title(title)
Plots a line chart of a dataframe.

  Args:
    df: The dataframe with data to plot.
    title: The title of the plot.
    group_by: Group data by this field, plot each one as a line in the figure.
    xaxis: The name of the column to use as the x-axis. If multiple entries have
      the same value in this field, the y-axis values are averaged.
    yaxis: The name of the column to use as the y-axis. The values in this
      column must be numerical.
    ax: The axis to plot on. If None, uses the current axis.
  
concordia/utils/plotting.py