Fix xlsx path to be relative to script location
Browse filesCo-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- src/streamlit_app.py +2 -1
src/streamlit_app.py
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
|
|
| 1 |
import pandas as pd
|
| 2 |
import numpy as np
|
| 3 |
import streamlit as st
|
|
@@ -93,7 +94,7 @@ REQUIRED_COLS = {"year", "month", "site_id", "section", "model", "eqm_no", "MA",
|
|
| 93 |
|
| 94 |
@st.cache_data
|
| 95 |
def load_default():
|
| 96 |
-
df = pd.read_excel("bad_actor_simulation.xlsx", sheet_name="data_badactor")
|
| 97 |
df.columns = df.columns.str.strip()
|
| 98 |
df["model"] = df["model"].astype(str)
|
| 99 |
return df
|
|
|
|
| 1 |
+
from pathlib import Path
|
| 2 |
import pandas as pd
|
| 3 |
import numpy as np
|
| 4 |
import streamlit as st
|
|
|
|
| 94 |
|
| 95 |
@st.cache_data
|
| 96 |
def load_default():
|
| 97 |
+
df = pd.read_excel(Path(__file__).parent / "bad_actor_simulation.xlsx", sheet_name="data_badactor")
|
| 98 |
df.columns = df.columns.str.strip()
|
| 99 |
df["model"] = df["model"].astype(str)
|
| 100 |
return df
|