How it works...

The where method again preserves the size and shape of the calling object and does not modify the values where the passed boolean is True. It was important to drop the missing values in step 1 as the where method would have eventually replaced them with a valid number in future steps.

The summary statistics in step 2 give us some intuition where it would make sense to cap our data. The histogram from step 3, on the other hand, appears to clump all the data into one bin. The data has too many outliers for a plain histogram to make a good plot. The where method allows us to place a ceiling and floor on our data, which results in a histogram with many more visible bars.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.189.180.43