Getting ready

One of the keys to understanding plotting in pandas is to know whether the plotting method requires one or two variables to make the plot. For instance, line and scatter plots require two variables to plot each point. The same holds true for bar plots, which require some x-coordinates to locate the bar and another variable for the height of the bar. Boxplots, histograms, and KDEs use only a single variable to make their plots.

The two-variable line and scatter plots, by default, use the index as the x axis and the values of the columns as the y axis. The one-variable plots ignore the index and apply a transformation or aggregation to each variable to make their plots. In this recipe, we will look at the differences between two-variable and one-variable plots in pandas.

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

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