Esmaeilkianii commited on
Commit
fd50ca0
·
verified ·
1 Parent(s): 7e7616b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -0
app.py CHANGED
@@ -589,6 +589,17 @@ def load_farm_data():
589
  'چاهک 2': 'Well2',
590
  'تاریخ قرائت.1': 'Well2Date'
591
  }, inplace=True, errors='ignore')
 
 
 
 
 
 
 
 
 
 
 
592
  return df
593
  except Exception as e:
594
  st.error(f"خطا در بارگذاری داده‌های مزارع: {e}")
 
589
  'چاهک 2': 'Well2',
590
  'تاریخ قرائت.1': 'Well2Date'
591
  }, inplace=True, errors='ignore')
592
+
593
+ # Convert numeric columns to appropriate types
594
+ numeric_columns = ['CurrentHeight', 'PreviousHeight', 'CurrentGrowth', 'PreviousGrowth',
595
+ 'CurrentNitrogen', 'StandardNitrogen', 'PreviousNitrogen', 'PreviousStandardNitrogen',
596
+ 'CurrentMoisture', 'StandardMoisture', 'PreviousMoisture', 'PreviousStandardMoisture',
597
+ 'Well1', 'Well2', 'Station1', 'Station2', 'Station3', 'Station4', 'Station5']
598
+
599
+ for col in numeric_columns:
600
+ if col in df.columns:
601
+ df[col] = pd.to_numeric(df[col], errors='coerce')
602
+
603
  return df
604
  except Exception as e:
605
  st.error(f"خطا در بارگذاری داده‌های مزارع: {e}")