Histograms can effectively represent the distribution of a variable. Here, we will visualize two normal distributions, both characterized by unit standard deviation, one having a mean of 0 and the other a mean of 3.0:

In: import numpy as np    import matplotlib.pyplot as plt    x = np.random.normal(loc=0.0, scale=1.0, size=500)    z = np.random.normal(loc=3.0, scale=1.0, size=500)    plt.hist(np.column_stack((x,z)),              bins=20,              histtype='bar',              color = ['c','b'],              stacked=True)    plt.grid()    plt.show()

The conjoint distributions can offer a different insight on the data if there is a classification problem:

There are a few ways to personalize ...

Get Python Data Science Essentials - Third Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.