Data is in below form:
first_name nick_name activity duration
Harish Escorts MC GUARD ASSEMBLY WITH CABINATE BRACKET 226
Harish Escorts COOLANT TANK AND SIDE DOORS, OPP DOORS 225
Narasaraj Escorts MC GUARD ASSEMBLY WITH CABINATE AND BRACKET MO 225
Narasaraj Escorts COOLANT TANK AND SIDE DOORS, OPP DOORS ASSEMBLY 150
PurushothamEscorts PNEUMATIC AND LUBRICATION ASSEMBLY 55
Shivu Escorts CABLE CARRIER AND AXIS MOTOR ASSEMBLY 123
Using seaborn I am doing a barplot:
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
sns.set(style="ticks", color_codes=True)
df = pd.read_excel('VMC & HMC data (sep&oct-15).xlsx', index = False)
df1 = df1[[ "first_name" , "nick_name", "activity" , "duration"]]
g = sns.catplot(x= 'first_name', y = 'duration', hue = 'activity' , data = df1, kind = 'bar', dodge=False, palette="deep", ci = None)
plt.ylim(0,300)
plt.gcf().autofmt_xdate()
for index, row in df1.iterrows():
g.text(row.name,row.first_name,row.duration, color='black', ha="center")
It throws me error as :
AttributeError: 'FacetGrid' object has no attribute 'text'