scikit_na.mpl
- scikit_na.mpl.plot_corr(data: pandas.core.frame.DataFrame, columns: Optional[Sequence[str]] = None, mask_diag: bool = True, corr_kws: Optional[dict] = None, heat_kws: Optional[dict] = None) → matplotlib.axes._subplots.SubplotBase
Plot a correlation heatmap.
- Parameters
data (DataFrame) – Input data.
columns (Optional[Sequence[str]], optional) – Columns names.
mask_diag (bool = True) – Mask diagonal on heatmap.
corr_kws (dict, optional) – Keyword arguments passed to
pandas.DataFrame.corr()
.heat_kws (dict, optional) – Keyword arguments passed to
pandas.DataFrame.heatmap()
.
- Returns
Heatmap AxesSubplot object.
- Return type
matplotlib.axes._subplots.AxesSubplot
- scikit_na.mpl.plot_heatmap(data: pandas.core.frame.DataFrame, columns: Optional[Sequence[str]] = None, droppable: bool = True, sort: bool = True, cmap: Optional[Sequence[str]] = None, names: Optional[Sequence[str]] = None, yaxis: bool = False, xaxis: bool = True, legend_kws: Optional[dict] = None, sb_kws: Optional[dict] = None) → matplotlib.axes._subplots.SubplotBase
NA heatmap. Plots NA values as red lines and normal values as black lines.
- Parameters
data (DataFrame) – Input data.
columns (Optional[Sequence[str]], optional) – Columns names.
droppable (bool, optional) – Show values to be dropped by
pandas.DataFrame.dropna()
method.sort (bool, optional) – Sort DataFrame by selected columns.
cmap (Optional[Sequence[str]], optional) – Heatmap and legend colormap: non-missing values, droppable values, NA values, correspondingly. Passed to
seaborn.heatmap()
method.names (Optional[Sequence[str]], optional) – Legend labels: non-missing values, droppable values, NA values, correspondingly.
yaxis (bool, optional) – Show Y axis.
xaxis (bool, optional) – Show X axis.
legend_kws (dict, optional) – Keyword arguments passed to
matplotlib.axes._subplots.AxesSubplot()
method.sb_kws (dict, optional) – Keyword arguments passed to
seaborn.heatmap()
method.
- Returns
AxesSubplot object.
- Return type
matplotlib.axes._subplots.AxesSubplot
- scikit_na.mpl.plot_hist(data: pandas.core.frame.DataFrame, col: str, col_na: str, col_na_fmt: str = '"{}" is NA', stat: str = 'density', common_norm: bool = False, hist_kws: Optional[dict] = None) → matplotlib.axes._subplots.SubplotBase
Histogram plot to compare distributions of values in column col split into two groups (NA/Non-NA) by column col_na in input DataFrame.
- Parameters
data (DataFrame) – Input DataFrame.
col (str) – Name of column to compare distributions of values.
col_na (str) – Name of column to group values by (NA/Non-NA).
col_na_fmt (str) – Legend title format string.
common_norm (bool, optional) – Use common norm.
hist_kws (dict, optional) – Keyword arguments passed to
seaborn.histplot()
.
- Returns
AxesSubplot returned by
seaborn.histplot()
.- Return type
SubplotBase
- scikit_na.mpl.plot_kde(data: pandas.core.frame.DataFrame, col: str, col_na: str, col_na_fmt: str = '"{}" is NA', common_norm: bool = False, kde_kws: Optional[dict] = None) → matplotlib.axes._subplots.SubplotBase
KDE plot to compare distributions of values in column col split into two groups (NA/Non-NA) by column col_na in input DataFrame.
- Parameters
data (DataFrame) – Input DataFrame.
col (str) – Name of column to compare distributions of values.
col_na (str) – Name of column to group values by (NA/Non-NA).
col_na_fmt (str) – Legend title format string.
common_norm (bool, optional) – Use common norm.
kde_kws (dict, optional) – Keyword arguments passed to
seaborn.kdeplot()
.
- Returns
AxesSubplot returned by
seaborn.kdeplot()
.- Return type
SubplotBase
- scikit_na.mpl.plot_stats(na_info: pandas.core.frame.DataFrame, idxstr: Optional[str] = None, idxint: Optional[int] = None, **kwargs) → matplotlib.axes._subplots.SubplotBase
Plot barplot with NA descriptive statistics.
- Parameters
na_info (DataFrame) – Typically, the output of
scikit_na.describe()
method.idxstr (str = None, optional) – Index string labels passed to
pandas.DataFrame.loc()
method.idxint (int = None, optional) – Index integer labels passed to
pandas.DataFrame.iloc()
method.kwargs (dict, optional) – Keyword arguments passed to
seaborn.barplot()
method.
- Returns
Barplot AxesSubplot object.
- Return type
matplotlib.axes._subplots.AxesSubplot
- Raises
ValueError – Raised if neither
idxstr
noridxint
are passed.