# 14.2 countplot आणि barplot

Source: https://ravindrabagale.com/mr/datascience/ch14-visualization-with-seaborn/14-2-countplot-and-barplot.html
Language: mr (Marathi with English technical terms)

countplot प्रत्येक category मधल्या rows मोजतो. City च्या row count नुसार chart चा क्रम ठेवू:

fig, ax = plt.subplots(figsize=(8, 4))
sns.countplot(data=df, x="city", order=df["city"].value_counts().index, ax=ax)
ax.set_title("Order lines by city (fictional)")
plt.xticks(rotation=30, ha="right")
fig.tight_layout()
plt.show()

barplot मात्र numeric value चं aggregation करतो. पुढे festival tag नुसार amount ची mean घेतली आहे; total नाही.

fig, ax = plt.subplots(figsize=(7, 4))
sns.barplot(data=df, x="festival", y="amount", estimator="mean", errorbar=None, ax=ax)
ax.set_title("Mean amount by festival tag (fictional)")
ax.set_ylabel("Mean amount (₹)")
plt.show()

रवींद्र बागले यांची tip

Row count म्हणजे order count असेलच असं नाही. Order-line grain असल्यास chart ला “Order lines” असंच label द्या.
