import streamlit as st import pandas as pd st.title('Dashboard de Venture Capital') st.markdown('Demo portafolio de Machine Learning y Venture Capital') # Load CSV into a DataFrame data = "./datasets/companies.csv" data = pd.read_csv(data) df = pd.DataFrame(data) # Get the column names for segmented control (e.g., 'Status' column) filters = df.columns.tolist() # This will give a list of column names in the dataframe # Add the segmented control widget to let the user choose a filter selected_filter = st.sidebar.segmented_control("Select a column to filter", filters) # Based on the selected filter, display options for filtering if selected_filter: unique_values = df[selected_filter].unique().tolist() selected_value = st.sidebar.selectbox(f"Select value to filter by {selected_filter}", unique_values) # Filter the dataframe based on the selected value filtered_df = df[df[selected_filter] == selected_value] # Display the filtered dataframe st.write(filtered_df)