Hi my name is Stephen, I am currently learning streamlit and i will like to create an emission calculator that will filter through an excel file using a drop list to find emission factors. After finding the emission factor it will match the unit (e.g. Tonnes) selected by the user and enable them to enter an amount to perform the calculation.
I have been able to upload the excel file that will be use to obtain the emission factors but i am struggling to create the drop down list to filter through the data, can any help?
my code does not allow me to select the unique values from the excel table
import streamlit as st import pandas as pd st.title("Carbon Emission Calculator Tool") # Load Excel file @st.cache_resource @st.cache_data def get_data (): path = "Emissions.xlsx" return pd.read_excel(path,sheet_name="Sheet1",usecols="A:F") data = get_data() scope = data.columns select_scope = st.selectbox('select scope:',scope) scope = data.columns selected_column = st.selectbox("Select Scope",options=scope) column_values = data[selected_column].unique()