Spaces:
Sleeping
Sleeping
Create visualize.py
Browse files- visualize.py +6 -0
visualize.py
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import matplotlib.pyplot as plt
|
2 |
+
|
3 |
+
def plot_spending_by_category(df):
|
4 |
+
category_spending = df.groupby("Category")["Amount"].sum()
|
5 |
+
category_spending.plot(kind="bar", title="Spending by Category", figsize=(8, 5))
|
6 |
+
plt.savefig("assets/spending_chart.png")
|