Implement base MissingValues strategies
This commit is contained in:
23
frontend/pages/normalization.py
Normal file
23
frontend/pages/normalization.py
Normal file
@@ -0,0 +1,23 @@
|
||||
import streamlit as st
|
||||
from mvstrategy import MVStrategy
|
||||
|
||||
if "data" in st.session_state:
|
||||
data = st.session_state.data
|
||||
st.session_state.data = data.copy()
|
||||
|
||||
for column, series in data.items():
|
||||
missing_count = series.isna().sum()
|
||||
choices = MVStrategy.list_available(series)
|
||||
option = st.selectbox(
|
||||
f"Missing values of {column} ({missing_count})",
|
||||
choices,
|
||||
index=1,
|
||||
key=f"mv-{column}",
|
||||
)
|
||||
# Always re-get the series to avoid reusing an invalidated series pointer
|
||||
data = option.apply(data, column, data[column])
|
||||
|
||||
st.write(data)
|
||||
st.session_state.working_data = data
|
||||
else:
|
||||
st.error("file not loaded")
|
@@ -5,8 +5,8 @@ import seaborn as sns
|
||||
st.header("Data Visualization")
|
||||
|
||||
|
||||
if "data" in st.session_state:
|
||||
data = st.session_state.data
|
||||
if "working_data" in st.session_state:
|
||||
data = st.session_state.working_data
|
||||
|
||||
st.subheader("Histogram")
|
||||
column_to_plot = st.selectbox("Select Column for Histogram", data.columns)
|
||||
|
Reference in New Issue
Block a user