import numpy as np
import pandas as pd
from pandas import Series, DataFrame
import seaborn as sn
address = 'mtcars.csv'
cars = pd.read_csv(address)
cars.columns = ['car_names', 'mpg', 'cyl', 'disp', 'hp', 'drat', 'wt', 'qsec', 'vs', 'am', 'gear', 'carb']
cars.head()
address = 'mtcars.csv'
cars = pd.read_csv(address)
cars.columns = ['car_names', 'mpg', 'cyl', 'disp', 'hp', 'drat', 'wt', 'qsec', 'vs',
'am', 'gear', 'carb']
cars.head()
cars_groups = cars.groupby(cars['cyl'])
#cars_groups.mean()
sn.barplot(x='cyl', y = 'disp', data = cars)
cars['cyl'].value_counts().plot.bar();
cars['gear'].value_counts().plot.bar();
cars_groups = cars.groupby(cars['gear'])
cars_groups.mean()
cars_groups = cars.groupby(cars['gear'])
cars_groups.count()