-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
34 lines (25 loc) · 895 Bytes
/
Copy pathmain.py
File metadata and controls
34 lines (25 loc) · 895 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import pandas as pd
from src.analysis import run_analysis
from src.insights import generate_insights
from src.prediction import predict_future
# Step 1: Create synthetic dataset
def create_data():
import numpy as np
np.random.seed(42)
dates = pd.date_range(start="2025-01-01", end="2025-03-31")
categories = ['Food', 'Rent', 'Travel', 'Shopping', 'Bills', 'Entertainment']
payment_methods = ['Cash', 'UPI', 'Card']
data = {
"Date": np.random.choice(dates, 200),
"Category": np.random.choice(categories, 200),
"Amount": np.random.randint(50, 5000, 200),
"Payment_Method": np.random.choice(payment_methods, 200)
}
df = pd.DataFrame(data)
df.to_csv("data/expenses.csv", index=False)
return df
if __name__ == "__main__":
df = create_data()
df = run_analysis(df)
generate_insights(df)
predict_future(df)