varshitha22 commited on
Commit
312d909
·
verified ·
1 Parent(s): 95e02e7

Update pages/Exploratory Data Analysis.py

Browse files
Files changed (1) hide show
  1. pages/Exploratory Data Analysis.py +3 -24
pages/Exploratory Data Analysis.py CHANGED
@@ -459,9 +459,9 @@ st.markdown("""
459
  }
460
  </style>
461
  <div class='insights-box'>
462
- 1. It grows well in dry and poor soil where other crops struggle.
463
- 2. Requires very little water and nutrients, making it cost-effective.
464
- 3. Has a stable market demand
465
  </div>
466
  """, unsafe_allow_html=True)
467
 
@@ -496,24 +496,3 @@ ax.tick_params(axis='y', labelsize=5) # Decreased y-axis tick size
496
  cbar = heatmap.collections[0].colorbar
497
  cbar.ax.tick_params(labelsize=4)
498
  st.pyplot(fig)
499
-
500
-
501
- st.markdown("<h2 style='color: #D35400; font-size: 23px;'> 🌾 Crop Recommendations by Season</h2>", unsafe_allow_html=True)
502
- summer_conditions = (df["Temperature"].between(20, 40)) & (df["Rainfall"].between(50, 200)) & (df["Humidity"].between(40, 70))
503
- rainy_conditions = (df["Temperature"].between(20, 30)) & (df["Rainfall"] > 200) & (df["Humidity"].between(65, 95))
504
- winter_conditions = (df["Temperature"].between(10, 20)) & (df["Rainfall"] < 150) & (df["Humidity"].between(30, 70))
505
-
506
- # **Get Unique Crops for Each Season**
507
- summer_crops = df[summer_conditions]["Crop"].unique().tolist()
508
- rainy_crops = df[rainy_conditions]["Crop"].unique().tolist()
509
- winter_crops = df[winter_conditions]["Crop"].unique().tolist()
510
-
511
- # **Display Crop Recommendations**
512
- st.markdown("<h2 style='color: #2E86C1; font-size: 23px;'> ☀ Summer Crops</h2>", unsafe_allow_html=True)
513
- st.markdown(f"<p style='font-size: 20px; color: black;'>{', '.join(summer_crops) if summer_crops else 'No crops suitable for summer.'}</p>", unsafe_allow_html=True)
514
-
515
- st.markdown("<h2 style='color: #2E86C1; font-size: 23px;'> 🌧 Rainy Season Crops</h2>", unsafe_allow_html=True)
516
- st.markdown(f"<p style='font-size: 20px; color: black;'>{', '.join(rainy_crops) if rainy_crops else 'No crops suitable for the rainy season.'}</p>", unsafe_allow_html=True)
517
-
518
- st.markdown("<h2 style='color: #2E86C1; font-size: 23px;'> ❄ Winter Crops</h2>", unsafe_allow_html=True)
519
- st.markdown(f"<p style='font-size: 20px; color: black;'>{', '.join(winter_crops) if winter_crops else 'No crops suitable for winter.'}</p>", unsafe_allow_html=True)
 
459
  }
460
  </style>
461
  <div class='insights-box'>
462
+ 1. It grows well in dry and poor soil where other crops struggle.<br>
463
+ 2. Requires very little water and nutrients, making it cost-effective.<br>
464
+ 3. Has a stable market demand.<br>
465
  </div>
466
  """, unsafe_allow_html=True)
467
 
 
496
  cbar = heatmap.collections[0].colorbar
497
  cbar.ax.tick_params(labelsize=4)
498
  st.pyplot(fig)