import pandas

import seaborn

data = pandas.read_csv('../input/wowah_data.csv')
data.columns = ['char', 'level', 'race', 'charclass', 'zone', 'guild', 'timestamp']

data['time'] = data['timestamp'].apply(pandas.to_datetime)

last70 = data[data['level'] == 70].groupby('char', as_index=False).last()
ding80 = data[data['level'] == 80].groupby('char', as_index=False).first()
ding80.columns = ['char', 'level', 'race', 'charclass', 'zone', 'guild', 'timestamp', 'ding80time']
last70.columns = ['char', 'level', 'race', 'charclass', 'zone', 'guild', 'timestamp', 'last70time']
characters = pandas.merge(ding80[['char', 'race', 'charclass', 'guild', 'ding80time']], last70[['char', 'last70time']], on='char')

mean_leveling_time = characters['leveling_time'].mean()
std_leveling_time = characters['leveling_time'].std()
characters_no_slowpokes = characters[characters['leveling_time'] - mean_leveling_time <= 3 * std_leveling_time]

seaborn.boxplot(x='charclass', y='leveling_time', data=characters_no_slowpokes)