EDAhelper.plot_histogram
Module Contents
Functions
|
Creates histograms for numerical features within a dataframe using Altair. |
- EDAhelper.plot_histogram.plot_histogram(data, columns=['all'], num_bins=30)[source]
Creates histograms for numerical features within a dataframe using Altair.
- Parameters
data (pd.DataFrame) – A pandas dataframe
columns (list, default=["all"]) – A list of numerical features for which to create histograms, or by default will plot all numerical features in dataframe.
num_bins (integer, default=30) – Number of bins in histogram plot, default is 30 bins.
- Returns
plot – An Altair plot for each specified numerical feature
- Return type
altair.Chart object
Examples
>>> df = pd.DataFrame({'A': [1, 2, 3], 'B' : [1.5, 2.5, 3.5], 'C' : ['one', 'two', 'three']}), >>> plot_histogram(df, columns = ['A', 'B'])