macrosynergy.visuals.grades#
Functions for visualizing data grading and blacklisted periods from a quantamental DataFrame.
- view_grades(df, xcats, cids=None, start=None, end=None, grade='grading', title=None, title_fontsize=16, figsize=None, return_fig=False, show=True)[source]#
Displays a heatmap of grading
- Parameters:
df (DataFrame) – standardized DataFrame with the necessary columns: ‘cid’, ‘xcat’, ‘real_date’ and ‘grading’.
xcats (List[str]) – extended categorys to be checked on.
cids (List[str]) – cross sections to visualize. Default is all in DataFrame.
start (str) – earliest date in ISO format. Default is earliest available.
end (str) – latest date in ISO format. Default is latest available.
grade (str) – name of column that contains the grades. Default is ‘grading’.
title (str) – string of chart title; defaults depend on type of range plot.
title_fontsize (int) – font size of the title; defaults to 16.
figsize (Tuple[float]) – Tuple of width and height of graph. Default is None, meaning it is set in accordance with df.