'Grouping and visualizing master data with Groupby

Let's say we group a multiple categorical variable with gruoup by and perform a Sum() operation on a variable.

ims_data2.groupby("Region").sum()

I want to visualize the resulting table as follows

sns.barplot(x="Region",y="productname MAT1" ,data=ims_data2);

However, in the resulting image, it visualizes the Y-axis of the graph by averaging. In other words, a visualization process based on the main table has been performed. It's like the table made with this

ims_data2.groupby("Region").sum()

code is just an image. If I wanted to see the real values on the y-axis, what should I follow? I can process the main table in excel, but this is not what I want of course.



Solution 1:[1]

You can use estimator parameter:

estimator: callable that maps vector -> scalar, optional

Statistical function to estimate within each categorical bin.

sns.barplot(x='Region', y='productname MAT1' ,data=ims_data2, estimator=sum)

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Corralien