Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -21,8 +21,16 @@ def load_data():
|
|
| 21 |
lead_time_data, inventory_data, optimization_data = load_data()
|
| 22 |
st.header("📊 Inventory Optimization Insights")
|
| 23 |
st.write("### Optimization Results Dataset")
|
| 24 |
-
|
| 25 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
st.write(optimization_data.describe())
|
| 27 |
st.write("### Optimization Trend")
|
| 28 |
if 'Optimization_Score' in optimization_data.columns:
|
|
@@ -78,5 +86,6 @@ if st.button("Save Results"):
|
|
| 78 |
inventory_data.to_csv("updated_inventory_data.csv", index=False)
|
| 79 |
st.success("Results saved to 'updated_inventory_data.csv'")
|
| 80 |
if __name__ == "__main__":
|
| 81 |
-
st
|
|
|
|
| 82 |
|
|
|
|
| 21 |
lead_time_data, inventory_data, optimization_data = load_data()
|
| 22 |
st.header("📊 Inventory Optimization Insights")
|
| 23 |
st.write("### Optimization Results Dataset")
|
| 24 |
+
page_size = 100 # Show 100 rows per page
|
| 25 |
+
total_rows = len(optimization_data)
|
| 26 |
+
page_num = st.number_input("Page Number", min_value=1, max_value=(total_rows // page_size) + 1, step=1)
|
| 27 |
+
|
| 28 |
+
start_idx = (page_num - 1) * page_size
|
| 29 |
+
end_idx = start_idx + page_size
|
| 30 |
+
|
| 31 |
+
st.write(f"### Showing rows {start_idx} to {end_idx}")
|
| 32 |
+
st.dataframe(optimization_data.iloc[start_idx:end_idx])
|
| 33 |
+
|
| 34 |
st.write(optimization_data.describe())
|
| 35 |
st.write("### Optimization Trend")
|
| 36 |
if 'Optimization_Score' in optimization_data.columns:
|
|
|
|
| 86 |
inventory_data.to_csv("updated_inventory_data.csv", index=False)
|
| 87 |
st.success("Results saved to 'updated_inventory_data.csv'")
|
| 88 |
if __name__ == "__main__":
|
| 89 |
+
import streamlit as st
|
| 90 |
+
st.write("Streamlit app is running!")
|
| 91 |
|