Categories DataFrames detector (association)#

pdcleaner.plots.multicategories.plot(self, color='green', errors_color='red', fmt='.0f')[source]#

plot a colored matrix (heatmap) représentation of categories associations.

Parameters:
  • color (palette name (Default: "green")) – Color associated to legitimate associations. Should be something that can be interpreted by seaborn’s color_palette()

  • errors_color (palette name (Default: "red")) – Color associated to erroneous associations. Should be something that can be interpreted by seaborn’s color_palette()

  • fmt (format (default : ".0f")) – String formatting code to use for the numbers.

Returns:

ax – Axes object with the heatmap.

Return type:

matplotlib Axes

Example

>>> import pandas as pd
>>> import pdcleaner
>>> df = pd.DataFrame({
            'col1': ['A'] * 10 + ['B'] * 10,
            'col2': ['a'] * 8 + ['c'] * 2 + ['b'] * 9 + ['a'],
    })
>>> detector = df.cleaner.detect.associations(count=3)
>>> detector.plot()
../../_images/plot_association.png