Update app.py
Browse files34 unmodified lines3536373839404120 unmodified lines626364656667686970717224 unmodified lines97989910010134 unmodified linesst.write("### Enter Your Details Below:")with st.form("solar_form"):state_options = df['State'].dropna().unique()location = st.selectbox("Select your State", options=sorted(state_options))roof_size = st.number_input("Enter your roof size (in sq meters)", min_value=1)20 unmodified lines# Generate the solar project estimate via Geminiif submitted and location and roof_size > 0 and electricity_bill >= 0:state_data = df[df['State'].str.contains(location, case=False)].iloc[0]if state_data is not None:ghi = state_data['Avg_GHI (kWh/m²/day)']solar_cost_per_kw = state_data['Solar_Cost_per_KW (₹)']prompt_text = build_prompt(location, roof_size, electricity_bill, ghi, solar_cost_per_kw)24 unmodified linesst.error("Sorry, the location entered does not match any available data.")else:st.warning("Please fill out all fields to see your solar project estimate.")34 unmodified lines3536373839404120 unmodified lines626364656667686970717224 unmodified lines97989934 unmodified linesst.write("### Enter Your Details Below:")with st.form("solar_form"):state_options = df['states'].dropna().unique() # Ensure using the correct column name 'states'location = st.selectbox("Select your State", options=sorted(state_options))roof_size = st.number_input("Enter your roof size (in sq meters)", min_value=1)20 unmodified lines# Generate the solar project estimate via Geminiif submitted and location and roof_size > 0 and electricity_bill >= 0:state_data = df[df['states'].str.contains(location, case=False)].iloc[0]if state_data is not None:ghi = state_data['Avg_GHI (kWh/m²/day)']solar_cost_per_kw = state_data['Solar_Cost_per_kW (₹)'] # Use the correct column name hereprompt_text = build_prompt(location, roof_size, electricity_bill, ghi, solar_cost_per_kw)24 unmodified linesst.error("Sorry, the location entered does not match any available data.")else:st.warning("Please fill out all fields to see your solar project estimate.")
app.py+3-5