Update app.py
Browse files15 unmodified lines161718192021222315 unmodified linesdf = load_data()# ---- Sidebar filter ----crop_options = sorted(df['crop_name'].dropna().unique())selected_crops = st.sidebar.multiselect("Filter by Crop", options=crop_options, default=crop_options[:5])# ---- Filtered Data ----filtered = df[df['crop_name'].isin(selected_crops)]15 unmodified lines1617181920212223242526272829303115 unmodified linesdf = load_data()# ---- Sidebar filter ----all_crops = sorted(df['crop_name'].dropna().unique())# Define 5 default crops (ensure they're present in the dataset)default_crops = [crop for crop in ['Corn', 'Soybeans', 'Wheat', 'Alfalfa', 'Sorghum'] if crop in all_crops]selected_crops = st.multiselect("Select crops to display:",options=all_crops,default=default_crops)# ---- Filtered Data ----filtered = df[df['crop_name'].isin(selected_crops)]
app.py+10-2