src/whylogs/viz/matplotlib/visualizer.py
def plot_data_types(self, variable, ts_format="%d-%b-%y", **kwargs):
        """Plots a Inferred Data Types chart."""
        if not self._confirm_profile_data:
            return

        chart_data = self._summary_data_preprocessing(variable)

        fig, ax = MatplotlibProfileVisualizer._chart_theming()

        type_metrics = {
            "Unknown": "type_unknown_count",
            "Null": "type_null_count",
            "Fractional": "type_fractional_count",
            "Integer": "type_integral_count",
            "Boolean": "type_boolean_count",
            "Text": "type_string_count",
        }

        for metric in type_metrics.keys():
            if chart_data.loc[:, type_metrics[metric]].sum() > 0:
                ax.plot(
                    chart_data.loc[:, "date"],
                    chart_data.loc[:, type_metrics[metric]],
                    linewidth=1.5,
                    label=metric,
                )

        ax.yaxis.set_label_text("Data Type Count", fontweight="bold")
        ax.set_title(f"Inferred Data Type ({variable})", loc="left", fontweight="bold")
        handles, labels = ax.get_legend_handles_labels()
        ax.legend(
            handles,
            labels,
            loc="upper center",
            bbox_to_anchor=(0.5, -0.1),
            frameon=False,
            ncol=3,
        )
        ax.xaxis.set_major_formatter(_dates.DateFormatter(ts_format))
        ax.yaxis.set_major_formatter(
            _ticker.ScalarFormatter(useOffset=False, useMathText=False, useLocale=None)
        )

        return fig
Plots a Inferred Data Types chart.
Plots a Inferred Data Types chart.
Plots a Inferred Data Types chart .
def plot_data_types(self, variable, ts_format="%d-%b-%y", **kwargs):
        if not self._confirm_profile_data:
            return
        chart_data = self._summary_data_preprocessing(variable)
        fig, ax = MatplotlibProfileVisualizer._chart_theming()
        type_metrics = {
            "Unknown": "type_unknown_count",
            "Null": "type_null_count",
            "Fractional": "type_fractional_count",
            "Integer": "type_integral_count",
            "Boolean": "type_boolean_count",
            "Text": "type_string_count",
        }
        for metric in type_metrics.keys():
            if chart_data.loc[:, type_metrics[metric]].sum() > 0:
                ax.plot(
                    chart_data.loc[:, "date"],
                    chart_data.loc[:, type_metrics[metric]],
                    linewidth=1.5,
                    label=metric,
                )
        ax.yaxis.set_label_text("Data Type Count", fontweight="bold")
        ax.set_title(f"Inferred Data Type ({variable})", loc="left", fontweight="bold")
        handles, labels = ax.get_legend_handles_labels()
        ax.legend(
            handles,
            labels,
            loc="upper center",
            bbox_to_anchor=(0.5, -0.1),
            frameon=False,
            ncol=3,
        )
        ax.xaxis.set_major_formatter(_dates.DateFormatter(ts_format))
        ax.yaxis.set_major_formatter(
            _ticker.ScalarFormatter(useOffset=False, useMathText=False, useLocale=None)
        )
        return fig
def plot_data_types ( self , variable , ts_format = "%d-%b-%y" , ** kwargs ) : if not self . _confirm_profile_data : return chart_data = self . _summary_data_preprocessing ( variable ) fig , ax = MatplotlibProfileVisualizer . _chart_theming ( ) type_metrics = { "Unknown" : "type_unknown_count" , "Null" : "type_null_count" , "Fractional" : "type_fractional_count" , "Integer" : "type_integral_count" , "Boolean" : "type_boolean_count" , "Text" : "type_string_count" , } for metric in type_metrics . keys ( ) : if chart_data . loc [ : , type_metrics [ metric ] ] . sum ( ) > 0 : ax . plot ( chart_data . loc [ : , "date" ] , chart_data . loc [ : , type_metrics [ metric ] ] , linewidth = 1.5 , label = metric , ) ax . yaxis . set_label_text ( "Data Type Count" , fontweight = "bold" ) ax . set_title ( f"Inferred Data Type ({variable})" , loc = "left" , fontweight = "bold" ) handles , labels = ax . get_legend_handles_labels ( ) ax . legend ( handles , labels , loc = "upper center" , bbox_to_anchor = ( 0.5 , - 0.1 ) , frameon = False , ncol = 3 , ) ax . xaxis . set_major_formatter ( _dates . DateFormatter ( ts_format ) ) ax . yaxis . set_major_formatter ( _ticker . ScalarFormatter ( useOffset = False , useMathText = False , useLocale = None ) ) return fig
Plots a Inferred Data Types chart.
Plots a Inferred Data Types chart .
"""Plots a Inferred Data Types chart."""
self
variable
ts_format