PersonalUPI / visualize.py
Ujeshhh's picture
Create visualize.py
0f9a667 verified
raw
history blame
260 Bytes
import matplotlib.pyplot as plt
def plot_spending_by_category(df):
category_spending = df.groupby("Category")["Amount"].sum()
category_spending.plot(kind="bar", title="Spending by Category", figsize=(8, 5))
plt.savefig("assets/spending_chart.png")