how to write a crosstab query in pandas and python with visualization
问题 this function display the crosstab table and visualize the result using matplotlib. def event_mouhafaza(self,df): df_event_mohafazat_crosstab = pd.crosstab(df['event_mohafaza'],df['event_type']) print(df_event_mohafazat_crosstab) data = [] #use for loop on every zoo name to create bar data for x in df_event_mohafazat_crosstab.columns: data.append(go.Bar(name=str(x), x=df_event_mohafazat_crosstab.index, y=df_event_mohafazat_crosstab[x])) layout = go.Layout( title = "Event type over Location",