Spaces:
Sleeping
Sleeping
Update pages/EDA.py
Browse files- pages/EDA.py +8 -8
pages/EDA.py
CHANGED
|
@@ -161,7 +161,7 @@ avg_potassium = df['Potassium'].mean()
|
|
| 161 |
# Function to plot bar charts
|
| 162 |
def plot_nutrient_crops(data, title):
|
| 163 |
crop_counts = data.value_counts()
|
| 164 |
-
fig, ax = plt.subplots(figsize=(
|
| 165 |
crop_counts.plot(kind='bar', color='skyblue', ax=ax)
|
| 166 |
ax.set_xlabel('Crops', fontsize=4)
|
| 167 |
ax.set_ylabel('Count', fontsize=4)
|
|
@@ -284,7 +284,7 @@ avg_Rainfall = df['Rainfall'].mean()
|
|
| 284 |
# Function to plot bar charts
|
| 285 |
def plot_climate_crops(data, title):
|
| 286 |
clim_crop_counts = data.value_counts()
|
| 287 |
-
fig, ax = plt.subplots(figsize=(
|
| 288 |
clim_crop_counts.plot(kind='bar', color='skyblue', ax=ax)
|
| 289 |
ax.set_xlabel('Crops', fontsize=4)
|
| 290 |
ax.set_ylabel('Count', fontsize=4)
|
|
@@ -317,9 +317,9 @@ st.markdown("""
|
|
| 317 |
}
|
| 318 |
</style>
|
| 319 |
<div class='insights-box'>
|
| 320 |
-
1. Papaya and orange grow best in warm, humid, and rainy climates
|
| 321 |
-
2. Jute and rice do well in high rainfall areas
|
| 322 |
-
3. Maize and cotton grow the least, meaning they might prefer drier climates
|
| 323 |
</div>
|
| 324 |
""", unsafe_allow_html=True)
|
| 325 |
|
|
@@ -350,8 +350,8 @@ st.markdown("""
|
|
| 350 |
}
|
| 351 |
</style>
|
| 352 |
<div class='insights-box'>
|
| 353 |
-
1. Maize and Kidney Beans Grow Best : These crops can grow well even in dry and less humid conditions with low rainfall. They are strong and can survive in tough climates
|
| 354 |
-
2. Chickpea and Lentil Grow Okay : They can manage in dry conditions but need some care, like proper soil and water
|
| 355 |
-
3. Moth Beans and Pigeon Peas Struggle : These crops don’t grow well in dry weather and need more rain and better soil
|
| 356 |
</div>
|
| 357 |
""", unsafe_allow_html=True)
|
|
|
|
| 161 |
# Function to plot bar charts
|
| 162 |
def plot_nutrient_crops(data, title):
|
| 163 |
crop_counts = data.value_counts()
|
| 164 |
+
fig, ax = plt.subplots(figsize=(4, 2)) # Adjusted plot size for better display
|
| 165 |
crop_counts.plot(kind='bar', color='skyblue', ax=ax)
|
| 166 |
ax.set_xlabel('Crops', fontsize=4)
|
| 167 |
ax.set_ylabel('Count', fontsize=4)
|
|
|
|
| 284 |
# Function to plot bar charts
|
| 285 |
def plot_climate_crops(data, title):
|
| 286 |
clim_crop_counts = data.value_counts()
|
| 287 |
+
fig, ax = plt.subplots(figsize=(4, 2)) # Adjusted plot size for better display
|
| 288 |
clim_crop_counts.plot(kind='bar', color='skyblue', ax=ax)
|
| 289 |
ax.set_xlabel('Crops', fontsize=4)
|
| 290 |
ax.set_ylabel('Count', fontsize=4)
|
|
|
|
| 317 |
}
|
| 318 |
</style>
|
| 319 |
<div class='insights-box'>
|
| 320 |
+
1. Papaya and orange grow best in warm, humid, and rainy climates.<br>
|
| 321 |
+
2. Jute and rice do well in high rainfall areas.<br>
|
| 322 |
+
3. Maize and cotton grow the least, meaning they might prefer drier climates.<br>
|
| 323 |
</div>
|
| 324 |
""", unsafe_allow_html=True)
|
| 325 |
|
|
|
|
| 350 |
}
|
| 351 |
</style>
|
| 352 |
<div class='insights-box'>
|
| 353 |
+
1. Maize and Kidney Beans Grow Best : These crops can grow well even in dry and less humid conditions with low rainfall. They are strong and can survive in tough climates.<br>
|
| 354 |
+
2. Chickpea and Lentil Grow Okay : They can manage in dry conditions but need some care, like proper soil and water.<br>
|
| 355 |
+
3. Moth Beans and Pigeon Peas Struggle : These crops don’t grow well in dry weather and need more rain and better soil.<br>
|
| 356 |
</div>
|
| 357 |
""", unsafe_allow_html=True)
|