October 2017
Intermediate to advanced
532 pages
16h 10m
English
With the exception of the scatter plot, all the plots did not specify the columns to be used. Pandas defaulted to using every single numeric column, as well as the index in the case of two-variable plots. You can, of course, specify the exact columns that you would like to use for each x or y value:
>>> fig, (ax1, ax2, ax3) = plt.subplots(1, 3, figsize=(16,4))>>> df.sort_values('Apples').plot(x='Apples', y='Oranges', kind='line', ax=ax1)>>> df.plot(x='Apples', y='Oranges', kind='bar', ax=ax2)>>> df.plot(x='Apples', kind='kde', ax=ax3)

Read now
Unlock full access