fork download
  1. import matplotlib.pyplot as plt
  2. import pandas as pd
  3.  
  4. # Sample expenses data (you can replace this with your actual data source)
  5. expenses_data = {
  6. 'Date': ['2024-04-01', '2024-04-02', '2024-04-03', '2024-04-04', '2024-04-05'],
  7. 'Amount': [50, 30, 70, 40, 60]
  8. }
  9.  
  10. # Convert data to DataFrame
  11. df = pd.DataFrame(expenses_data)
  12. df['Date'] = pd.to_datetime(df['Date'])
  13.  
  14. # Plotting the expenses chart
  15. plt.figure(figsize=(10, 6))
  16. plt.plot(df['Date'], df['Amount'], marker='o')
  17. plt.title('Daily Expenses')
  18. plt.xlabel('Date')
  19. plt.ylabel('Amount')
  20. plt.grid(True)
  21. plt.xticks(rotation=45)
  22. plt.tight_layout()
  23.  
  24. # Display the chart
  25. plt.show()
Success #stdin #stdout 2.41s 82396KB
stdin
Milk
12/3/2005
1000
stdout
Standard output is empty