Ujeshhh commited on
Commit
0f9a667
·
verified ·
1 Parent(s): 923c242

Create visualize.py

Browse files
Files changed (1) hide show
  1. 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")