April 2019
Intermediate to advanced
426 pages
11h 13m
English
Histograms tell us how distributed data is. In this example, we are interested in how distributed the daily returns of ABN are. We use the hist() method on a DataFrame with a bin size of 50:
In [ ]: daily_changes.hist(bins=50, figsize=(8, 4));
The histogram output is shown as follows:

When there are multiple data columns in a pandas DataFrame, the hist() method will automatically plot each histogram on its own separate plot.
We can use the describe() method to summarize the central tendency, dispersion, and shape of a dataset's distribution:
In [ ]: daily_changes.describe()Out[ ]: Last count 692.000000 mean 0.000499 std ...
Read now
Unlock full access