Esmaeilkiani commited on
Commit
494ed19
·
verified ·
1 Parent(s): a9f7c2e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -5
app.py CHANGED
@@ -1,12 +1,22 @@
1
  import streamlit as st
2
  import pandas as pd
3
  import matplotlib.pyplot as plt
 
4
 
5
- # Load the data files
6
- cleaned_data = pd.read_csv('cleaned_data.csv')
7
- veg_index_data = pd.read_csv('SentinelTimeSeries_Sugarcane (2) (3).csv')
8
- weather_data = pd.read_csv('weather_data.csv') # Replace with your weather data file
9
- performance_estimation_data = pd.read_csv('تخمین تناژ.csv') # Replace with your yield estimation file
 
 
 
 
 
 
 
 
 
10
 
11
  # Function to search for farm performance
12
  def search_farm(farm_name):
@@ -76,3 +86,4 @@ elif menu == "پیش بینی عملکرد":
76
 
77
  if st.button("پیش بینی"):
78
  predict_performance(farm_name_prediction)
 
 
1
  import streamlit as st
2
  import pandas as pd
3
  import matplotlib.pyplot as plt
4
+ from datasets import load_dataset
5
 
6
+ # Load the dataset from Hugging Face
7
+ dataset = load_dataset('Esmaeilkianii/croplogdehkhoda', split='train')
8
+ data = pd.DataFrame(dataset)
9
+
10
+ # Split the data into different sections based on columns or logic
11
+ # Assuming the dataset contains the combined information for all four files
12
+
13
+ # Separate different sections of the data
14
+ cleaned_data = data[['مزرعه', 'year', 'yield', 'age', 'variety', 'area']] # Example farm performance data
15
+ veg_index_data = data[['مزرعه', 'date', 'mean_VH', 'mean_VV']] # Example vegetation index data
16
+ weather_data = data[['سال', 'ماه', 'روز', 'تاریخ', 'درجه حرارت حداقل', 'درجه حرارت حداکثر', 'میانگین درجه حرارت',
17
+ 'حداقل رطوبت نسبی (درصد)', 'حداکثر رطوبت نسبی (درصد)', 'میانگین رطوبت نسبی (درصد)',
18
+ 'میزان تبخیر روزانه (میلیمتر)', 'میزان بارندگی (میلیمتر)', 'میزان ساعت افتابی']] # Weather data
19
+ performance_estimation_data = data[['مزرعه', 'yield', 'tonnage']] # Example yield and tonnage prediction
20
 
21
  # Function to search for farm performance
22
  def search_farm(farm_name):
 
86
 
87
  if st.button("پیش بینی"):
88
  predict_performance(farm_name_prediction)
89
+