rairo commited on
Commit
cb9d1ec
·
verified ·
1 Parent(s): 95eb0a5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -29,8 +29,8 @@ class SmartShoppingAssistant:
29
  def setup_agent(self):
30
  def search_products(query):
31
  try:
32
- if 'price' in self.df.columns:
33
- self.df['price'] = pd.to_numeric(self.df['price'].str.replace('$', ''), errors='coerce')
34
  results = self.df.query(query)
35
  return results.to_string() if not results.empty else "No products found matching your criteria."
36
  except Exception as e:
@@ -107,7 +107,7 @@ def main():
107
 
108
  @st.cache_data
109
  def load_product_data():
110
- return pd.read_csv('supermarket.csv')
111
 
112
  df = load_product_data()
113
  assistant = SmartShoppingAssistant(df)
 
29
  def setup_agent(self):
30
  def search_products(query):
31
  try:
32
+ if 'RetailPrice' in self.df.columns:
33
+ self.df['RetailPrice'] = pd.to_numeric(self.df['RetailPrice'].str.replace('$', ''), errors='coerce')
34
  results = self.df.query(query)
35
  return results.to_string() if not results.empty else "No products found matching your criteria."
36
  except Exception as e:
 
107
 
108
  @st.cache_data
109
  def load_product_data():
110
+ return pd.read_csv('supermarket2.csv')
111
 
112
  df = load_product_data()
113
  assistant = SmartShoppingAssistant(df)