pycredits.column_histogram

Module Contents

Functions

column_histogram(fig_width, fig_height, data_frame, ...)

Create a histogram for a numerical column in a dataframe.

exception pycredits.column_histogram.EmptyDataFrameError[source]

Bases: ValueError

raise this when there is an empty DataFrame passed to the function

exception pycredits.column_histogram.NumericColumnError[source]

Bases: TypeError

raise this when the column of interest for the histogram is not numeric

pycredits.column_histogram.column_histogram(fig_width, fig_height, data_frame, column_name)[source]

Create a histogram for a numerical column in a dataframe.

Parameters:

fig_widthint

The width of the figure created.

fig_heightint

The height of the figure created.

data_framepandas.DataFrame

The input DataFrame containing the data to plot.

column_namestr

The name of the numerical column in the DataFrame that we want to plot.

Returns:

matplotlib.axes._axes.Axes

A Matplotlib Axes object.

Examples:

>>> import matplotlib.pyplot as plt
>>> import seaborn as sns
>>> column_histogram(10, 4, pd.DataFrame({'Age': [20, 30, 40, 50]}), "Age")