Experts often possess more data than judgment.

Colin Powell

Working with data is both an art and a science. We’ve mostly been talking about the science part, but in this chapter we’ll look at some of the art.

After you’ve identified the questions you’re trying to answer and have gotten
your hands on some data, you might be tempted to dive in and immediately start
building models and getting answers. But you should resist this urge.
Your first step should be to *explore* your data.

The simplest case is when you have a one-dimensional dataset, which is just a collection of numbers. For example, these could be the daily average number of minutes each user spends on your site, the number of times each of a collection of data science tutorial videos was watched, or the number of pages of each of the data science books in your data science library.

An obvious first step is to compute a few summary statistics. You’d like to know how many data points you have, the smallest, the largest, the mean, and the standard deviation.

But even these don’t necessarily give you a great understanding. A good next step is to create a histogram, in which you group your data into discrete *buckets* and count how many points fall into each bucket:

`from`

`typing`

`import`

`List`

`,`

`Dict`

`from`

`collections`

`import`

`Counter`

`import`

`math`

`import`

`matplotlib.pyplot`

`as`

`plt`

`def`

`bucketize`

`(`

`point`

`:`

`float`

`,`

`bucket_size`

`:`

`float`

`)`

`->`

`float`

`:`

`"""Floor the point ...`

Start Free Trial

No credit card required