Often, the data we have is not structured the way we want to use it. A structuring technique we can use is called (statistical) data binning or bucketing. This strategy replaces values within an interval (a bin) with one representative value. In the process, we may lose information; however, we gain better control over the data and efficiency.
In the weather dataset, we have wind direction in degrees and wind speed in m/s, which can be represented in a different way. In this recipe, I chose to present wind direction with cardinal directions (north, south, and so on). For the wind speed, I used the Beaufort scale (visit https://en.wikipedia.org/wiki/Beaufort_scale).
Follow these instructions to rebin the data:
The imports are as follows:
import dautil as dl import seaborn as sns import matplotlib.pyplot as plt import pandas as pd import numpy as np from IPython.display import HTML
Load and rebin the data as follows (wind direction is in degree 0-360; we rebin to cardinal...