MCPcopy Create free account
hub / github.com/Hrishikesh332/HCDS-EPD / load_data

Function load_data

utils.py:26–36  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

24}
25
26def 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
38def gen_sample_data():
39 regions = [

Callers 1

load_and_cache_dataFunction · 0.90

Calls 1

gen_sample_dataFunction · 0.85

Tested by

no test coverage detected