Pandas functions
Pandas Bar Plot β DataFrame.plot.bar()
Create bar plot from DataFrame in pandas
Pandas Bar Plot is a great way to visually compare 2 or more items together. Traditionally, bar plots use the y-axis to show how values compare to each other.
In order to make a bar plot from your DataFrame, you need to pass a X-value and a Y-value. Pandas will draw a chart for you automatically.
Pseudo Code: Construct a bar plot from a column(s) and index within a DataFrame.
Pandas Bar Plot
Resample Main Parameters
- x β What you want to have your bars be. This is traditionally a label (cat, dog, mouse).
- y β What you want the values or height of your bar plot to be. This is almost always a number (3, 4, 5, 6, etc.)
- color β The color you want your bars to be. If you have multiple sets of bars (like in a grouped or stacked bar plot) you can pass multiple colors via a list or dict.
- **kwargs β Pandas plot has a ton of general parameters you can pass. These are all agnostic to the type of plot you do.
Now the fun part, letβs take a look at a code sample