Spaces:
Sleeping
Sleeping
Update pages/EDA.py
Browse files- pages/EDA.py +10 -10
pages/EDA.py
CHANGED
|
@@ -163,11 +163,11 @@ def plot_nutrient_crops(data, title):
|
|
| 163 |
crop_counts = data.value_counts()
|
| 164 |
fig, ax = plt.subplots(figsize=(6, 3)) # Adjusted plot size for better display
|
| 165 |
crop_counts.plot(kind='bar', color='skyblue', ax=ax)
|
| 166 |
-
ax.set_xlabel('Crops', fontsize=
|
| 167 |
-
ax.set_ylabel('Count', fontsize=
|
| 168 |
-
ax.set_title(title, fontsize=
|
| 169 |
-
ax.tick_params(axis='x', labelsize=
|
| 170 |
-
ax.tick_params(axis='y', labelsize=
|
| 171 |
st.pyplot(fig)
|
| 172 |
|
| 173 |
# Plot: Crops in Nutrient-Rich Soil
|
|
@@ -273,13 +273,13 @@ st.markdown("""
|
|
| 273 |
|
| 274 |
|
| 275 |
|
| 276 |
-
st.markdown("<h2 style='text-align: left; color: #D35400;font-size: 23px;'>Crops that require above-average
|
| 277 |
|
| 278 |
# Calculate average of climate factors
|
| 279 |
-
|
| 280 |
-
|
| 281 |
-
|
| 282 |
-
|
| 283 |
|
| 284 |
# Function to plot bar charts
|
| 285 |
def plot_climate_crops(data, title):
|
|
|
|
| 163 |
crop_counts = data.value_counts()
|
| 164 |
fig, ax = plt.subplots(figsize=(6, 3)) # Adjusted plot size for better display
|
| 165 |
crop_counts.plot(kind='bar', color='skyblue', ax=ax)
|
| 166 |
+
ax.set_xlabel('Crops', fontsize=7)
|
| 167 |
+
ax.set_ylabel('Count', fontsize=7)
|
| 168 |
+
ax.set_title(title, fontsize=7)
|
| 169 |
+
ax.tick_params(axis='x', labelsize=7) # Adjust x-axis label size
|
| 170 |
+
ax.tick_params(axis='y', labelsize=7) # Adjust y-axis label size
|
| 171 |
st.pyplot(fig)
|
| 172 |
|
| 173 |
# Plot: Crops in Nutrient-Rich Soil
|
|
|
|
| 273 |
|
| 274 |
|
| 275 |
|
| 276 |
+
st.markdown("<h2 style='text-align: left; color: #D35400;font-size: 23px;'>Crops that require above-average climate factors</h2>", unsafe_allow_html=True)
|
| 277 |
|
| 278 |
# Calculate average of climate factors
|
| 279 |
+
avg_Temperature = df['Temperature'].mean()
|
| 280 |
+
avg_Humidity = df['Humidity'].mean()
|
| 281 |
+
avg_pH_Value = df['pH_Value'].mean()
|
| 282 |
+
avg_Rainfall = df['Rainfall'].mean()
|
| 283 |
|
| 284 |
# Function to plot bar charts
|
| 285 |
def plot_climate_crops(data, title):
|