genetic_algorithm / pages /3_Variables_Table.py
robitalhazmi's picture
Add additional content
4a832b8
import streamlit as st
import pandas as pd
def run():
st.set_page_config(page_title="Variables Table", layout="wide")
st.title("Variables Table")
# Define the data for the variables table
data = {
"Variable Name": ["age", "sex", "cp", "trestbps", "chol", "fbs", "restecg", "thalach", "exang", "oldpeak", "slope", "ca", "thal", "num"],
"Role": ["Feature", "Feature", "Feature", "Feature", "Feature", "Feature", "Feature", "Feature", "Feature", "Feature", "Feature", "Feature", "Feature", "Target"],
"Type": ["Integer", "Categorical", "Categorical", "Integer", "Integer", "Categorical", "Categorical", "Integer", "Categorical", "Integer", "Categorical", "Integer", "Categorical", "Integer"],
"Demographic": ["Age", "Sex", None, None, None, None, None, None, None, None, None, None, None, None],
"Description": [None, None, None, "Resting blood pressure (on admission to the hospital)", "Serum cholestoral", "Fasting blood sugar > 120 mg/dl", None, "Maximum heart rate achieved", "Exercise induced angina", "ST depression induced by exercise relative to rest", None, "Number of major vessels (0-3) colored by flourosopy", None, "Diagnosis of heart disease"],
"Units": ["years", None, None, "mm Hg", "mg/dl", None, None, "beats per minute", None, None, None, None, None, None],
"Missing Values": ["no", "no", "no", "no", "no", "no", "no", "no", "no", "no", "no", "yes", "yes", "no"]
}
# Create DataFrame from the data
df = pd.DataFrame(data)
# Display the DataFrame as a table with larger size
st.table(df.style.set_table_styles([{'selector': 'tr:hover','props': [('background-color', '#95caff')]}]))
# Add a footer
st.markdown("---")
st.write("Made with ❤️ by Viga, Hanum, & Robit")
if __name__ == "__main__":
run()