Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Mastering Numerical Computing with NumPy

You're reading from  Mastering Numerical Computing with NumPy

Product type Book
Published in Jun 2018
Publisher Packt
ISBN-13 9781788993357
Pages 248 pages
Edition 1st Edition
Languages
Authors (3):
Umit Mert Cakmak Umit Mert Cakmak
Profile icon Umit Mert Cakmak
Tiago Antao Tiago Antao
Profile icon Tiago Antao
Mert Cuhadaroglu Mert Cuhadaroglu
Profile icon Mert Cuhadaroglu
View More author details

Table of Contents (11) Chapters

Preface Working with NumPy Arrays Linear Algebra with NumPy Exploratory Data Analysis of Boston Housing Data with NumPy Statistics Predicting Housing Prices Using Linear Regression Clustering Clients of a Wholesale Distributor Using NumPy NumPy, SciPy, Pandas, and Scikit-Learn Advanced Numpy Overview of High-Performance Numerical Computing Libraries Performance Benchmarks Other Books You May Enjoy

Computing histograms

A histogram is a visual representation of the distribution of numerical data. Karl Pearson first introduced this concept more than a century ago. A histogram is a kind of bar chart that is used for continuous data, while a bar chart visually represents categorical variables. As a first step, you need to divide your entire range of values into a series of intervals (bins). Each bin has to be adjacent and none of them can overlap. In general, bin sizes are equal, and the rule of thumb for the number of bins to include is 5–20. This means that if you have more than 20 bins, your graph will be hard to read. On the contrary, if you have fewer than 5 bins, then your graph will give very little insight into the distribution of your data:

In [48]: %matplotlib notebook
%matplotlib notebook
import matplotlib.pyplot as plt
NOX = samples...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}