Spaces:
Sleeping
Sleeping
caching dataframe loading and plotting by row
Browse files- src/display.py +2 -2
- src/load_data.py +2 -2
src/display.py
CHANGED
|
@@ -69,8 +69,8 @@ def display_app():
|
|
| 69 |
|
| 70 |
with column2:
|
| 71 |
if grid_response['selected_rows'] is not None and len(grid_response['selected_rows']) > 0:
|
| 72 |
-
|
| 73 |
-
figure = plot_radar_chart_name(dataframe= dataframe, model_name=grid_response['selected_rows'][0]["model_name"])
|
| 74 |
st.plotly_chart(figure, use_container_width=True)
|
| 75 |
else:
|
| 76 |
if len(subdata)>0:
|
|
|
|
| 69 |
|
| 70 |
with column2:
|
| 71 |
if grid_response['selected_rows'] is not None and len(grid_response['selected_rows']) > 0:
|
| 72 |
+
figure = plot_radar_chart_rows(rows=grid_response['selected_rows'])
|
| 73 |
+
#figure = plot_radar_chart_name(dataframe= dataframe, model_name=grid_response['selected_rows'][0]["model_name"])
|
| 74 |
st.plotly_chart(figure, use_container_width=True)
|
| 75 |
else:
|
| 76 |
if len(subdata)>0:
|
src/load_data.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
import pandas as pd
|
| 3 |
|
| 4 |
-
|
| 5 |
def load_dataframe() -> pd.DataFrame:
|
| 6 |
"""
|
| 7 |
Load dataframe from the csv file in public directory
|
|
@@ -13,7 +13,7 @@ def load_dataframe() -> pd.DataFrame:
|
|
| 13 |
dataframe = dataframe.drop(columns = "Unnamed: 0")
|
| 14 |
return dataframe
|
| 15 |
|
| 16 |
-
|
| 17 |
def sort_by(dataframe: pd.DataFrame, column_name: str, ascending:bool = False) -> pd.DataFrame:
|
| 18 |
"""
|
| 19 |
Sort the dataframe by column_name
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
import pandas as pd
|
| 3 |
|
| 4 |
+
@st.cache_data
|
| 5 |
def load_dataframe() -> pd.DataFrame:
|
| 6 |
"""
|
| 7 |
Load dataframe from the csv file in public directory
|
|
|
|
| 13 |
dataframe = dataframe.drop(columns = "Unnamed: 0")
|
| 14 |
return dataframe
|
| 15 |
|
| 16 |
+
@st.cache_data
|
| 17 |
def sort_by(dataframe: pd.DataFrame, column_name: str, ascending:bool = False) -> pd.DataFrame:
|
| 18 |
"""
|
| 19 |
Sort the dataframe by column_name
|