O'Reilly logo

Learning pandas - Second Edition by Michael Heydt

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Picturing distributions of data with histograms

Histograms are useful for visualizing distributions of data. The following code generates a histogram based on 1000 random values in a normal distribution:

The resolution of a histogram can be controlled by specifying the number of bins to allocate to the graph. The default is 10, and increasing the number of bins gives finer details to the histogram. This code increases the number of bins to 100:

If the data has multiple series, the histogram function will automatically generate multiple histograms, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required