December 2018
Beginner to intermediate
682 pages
18h 1m
English
In step 2, the cut function places each value of the DIST column into one of five bins. The bins are created by a sequence of six numbers defining the edges. You always need one more edge than the number of bins. You can pass the bins parameter an integer, which automatically creates that number of equal-width bins. Negative infinity and positive infinity objects are available in NumPy and ensure that all values get placed in a bin. If you have values that are outside of the bin edges, they will be made missing and not be placed in a bin.
The cuts variable is now a Series of five ordered categories. It has all the normal Series methods and in step 3, the value_counts method is used to get a sense of its distribution.
Very ...