streamlit init

pull/20/head
remrem 5 months ago
parent 16dbffe49f
commit ba319d6243

@ -0,0 +1,2 @@
[client]
showSidebarNavigation = false

Binary file not shown.

@ -0,0 +1,49 @@
import streamlit as st
from io import StringIO
import pandas as pd
def statistics(df):
nan_counts = df.isnull().sum(axis=1).sum()
st.write("*Number of columns*:", len(df.columns))
st.write("*Number of rows*:", len(df.index))
st.write("*Nan Counts*: ", nan_counts)
st.write(df.isna().sum())
def display_df_first_and_lasts_lines(df):
fl = df.head(10)
ll = df.tail(10)
concat = pd.concat([fl, ll])
st.dataframe(concat)
def nav_bar():
st.page_link("./home.py", label="Import", icon="⬆️", help=None)
st.page_link("pages/clean.py", label="Clean", icon="🧼", help=None)
st.page_link("pages/visualize.py", label="Visualize", icon="👁️", help=None)
st.page_link("pages/prediction.py", label="Predict", icon="🔮", help=None)
st.page_link("pages/evaluate.py", label="Evaluate", icon=None, help=None)
def clean_dataframe(line):
# Call to function to clean data
line.empty()
line.write("Dataframe has been cleaned")
def main():
nav_bar()
st.write("# Pow: Your data analyser")
uploaded_file = st.file_uploader("Choose a file")
if uploaded_file is not None:
df = pd.read_csv(uploaded_file)
st.session_state.orig_df = df
st.write("## Dataframe (10 first/last lines)")
display_df_first_and_lasts_lines(df)
st.write("## Statistics")
statistics(df)
if st.button("Next"):
st.switch_page("pages/clean.py")
main()

@ -0,0 +1,18 @@
import streamlit as st
st.write("# 🧼 Data cleaning")
st.write("## Missing data")
rm_empty_rows_or_cols = st.checkbox("Remove empty rows or columns", True)
st.write("#### Replace missing values")
replace_methods = ["Mean","Median","Mode","KNN","Regression"]
replace_method = st.radio('Choose an option:', replace_methods)
st.write("## Normalize data")
normalize_methods = ["Min-Max","Z-Score","Another One"]
normalize_method = st.radio('Choose an option:', normalize_methods)
if st.button("Clean dataset"):
# TODO: Actual processing
st.write("TODO")

@ -0,0 +1,23 @@
import streamlit as st
import matplotlib.pyplot as plt
df = st.session_state.orig_df
df_columns = df.columns.tolist()
st.write("# 📊 Visualization")
st.write("## Histograms")
hist_tabs = st.tabs(df_columns)
for idx, tab in enumerate(hist_tabs):
tab.write("##### "+df_columns[idx])
tab.bar_chart(df[df_columns[idx]])
st.write("## Box & Whisker")
baw_tabs = st.tabs(df_columns)
for idx, tab in enumerate(baw_tabs):
tab.write("##### "+df_columns[idx])
fig, ax = plt.subplots()
df[df_columns[idx]].plot(kind='box')
st.pyplot(fig)
Loading…
Cancel
Save