import pandas as pd
from datetime import datetime
def forecast_cash_flow(historical, months=12):
avg_inflow = historical['inflow'].mean()
avg_outflow = historical['outflow'].mean()
net = avg_inflow - avg_outflow
forecast = []
for m in range(1, months + 1):
forecast.append({'month': m, 'net': net * (1 + 0.02 * m)})
return forecast
def identify_shortfall(forecast, threshold=0):
return [f for f in forecast if f['net'] < threshold]