Bar Charts
Bar charts are a helpful way to visualize categorical summaries such as mean and counts, in a side-by-side comparison. They can often help understand the cross-distribution of the dataset. This example looks at the Electric Vehicle population in the State of Washington.
import pygal
import numpy as np
import pandas as pd
cars = pd.read_csv('dataset/Electric_Vehicle_Population_Data.csv')
electric_cars = cars.groupby(['Make'])['VIN (1-10)'].count() #.agg({ 'VIN (1-10)': 'count' })
electric_cars.head()
bar = pygal.Bar( x_label_rotation= -40 )
bar.title = 'Electric Vehicle Population in WA'
for x in electric_cars.items():
bar.add(x[0], x[1])
bar.render_in_browser()