notebooks/common.py
def add_summary_line(ax, df, column, l_color, function, argument, label=None, rot=0):
    """Add a line summary to the plot as calculated by function()"""
    series = df[column].sum(axis=1, skipna=True) if type(column) is list else df[column]
    times = df['Mean Date']
    summary = function(series, times, argument)
    if summary is not None:
        ax.plot(times, summary, lw=2.5, c=l_color, label=label)
        annotate_endpoint(ax, series=summary, end=times.iloc[-1]+pd.Timedelta(days=5), rot=rot)
    add_h_refence(ax, reference=50)
Add a line summary to the plot as calculated by function()
Add a line summary to the plot as calculated by function()
Add a line summary to the plot as calculated by function ()
def add_summary_line(ax, df, column, l_color, function, argument, label=None, rot=0):
    series = df[column].sum(axis=1, skipna=True) if type(column) is list else df[column]
    times = df['Mean Date']
    summary = function(series, times, argument)
    if summary is not None:
        ax.plot(times, summary, lw=2.5, c=l_color, label=label)
        annotate_endpoint(ax, series=summary, end=times.iloc[-1]+pd.Timedelta(days=5), rot=rot)
    add_h_refence(ax, reference=50)
def add_summary_line ( ax , df , column , l_color , function , argument , label = None , rot = 0 ) : series = df [ column ] . sum ( axis = 1 , skipna = True ) if type ( column ) is list else df [ column ] times = df [ 'Mean Date' ] summary = function ( series , times , argument ) if summary is not None : ax . plot ( times , summary , lw = 2.5 , c = l_color , label = label ) annotate_endpoint ( ax , series = summary , end = times . iloc [ - 1 ] + pd . Timedelta ( days = 5 ) , rot = rot ) add_h_refence ( ax , reference = 50 )
Add a line summary to the plot as calculated by function()
Add a line summary to the plot as calculated by function ()
"""Add a line summary to the plot as calculated by function()"""
ax
df
column
l_color
function
argument
label
rot