henchman.plotting.piechart

henchman.plotting.piechart(col, sort=True, mergepast=None, drop_n=None, figargs=None)[source]

Creates a piechart. Finds all of the unique values in a column and makes a piechart out of them. By default, this will make a dynamic piechart with sliders for the different parameters.

Parameters:
  • col (pd.Series) – The column from which to make the piechart.
  • sort (bool) – Whether or not to sort by frequency for static plot. Default is True.
  • mergepast (int) – Merge infrequent column values for static plot. Default is 10.
  • drop_n (int) – How many high frequency values to drop for static plot. Default is None.

Example

If the dataframe X has a column named car_color:

>>> import henchman.plotting as hplot
>>> plot = hplot.piechart(X['car_color'])
>>> hplot.show(plot)

For a static plot:

>>> import henchman.plotting as hplot
>>> plot = hplot.piechart(X['car_color'], sort=False)
>>> hplot.show(plot, static=True)