()
| 24 | } |
| 25 | |
| 26 | def load_data(): |
| 27 | try: |
| 28 | df = pd.read_csv("monthly_summary.csv") |
| 29 | df["YEAR_MONTH"] = pd.to_datetime(df["YEAR_MONTH"]) |
| 30 | df["TOTAL_COST"] = pd.to_numeric(df["TOTAL_COST"], errors="coerce") |
| 31 | df = df.dropna(subset=['TOTAL_COST']) |
| 32 | return df, "real" |
| 33 | except FileNotFoundError: |
| 34 | return gen_sample_data(), "sample" |
| 35 | except Exception: |
| 36 | return gen_sample_data(), "sample" |
| 37 | |
| 38 | def gen_sample_data(): |
| 39 | regions = [ |
no test coverage detected