Gopala Krishna
commited on
Commit
·
907ef1c
1
Parent(s):
89c51df
add try except for file access
Browse files- .vs/UBCFProductRecommendations/FileContentIndex/0aa3bc32-ca3d-4275-aa8e-318fe2e1b2b3.vsidx +0 -0
- .vs/UBCFProductRecommendations/FileContentIndex/{800f1087-579e-4bc8-8fc3-587302d5fa2d.vsidx → 80b4ee3a-0898-4c31-97d4-b745d381e419.vsidx} +0 -0
- .vs/UBCFProductRecommendations/v17/.wsuo +0 -0
- app.py +4 -1
.vs/UBCFProductRecommendations/FileContentIndex/0aa3bc32-ca3d-4275-aa8e-318fe2e1b2b3.vsidx
ADDED
Binary file (12.1 kB). View file
|
|
.vs/UBCFProductRecommendations/FileContentIndex/{800f1087-579e-4bc8-8fc3-587302d5fa2d.vsidx → 80b4ee3a-0898-4c31-97d4-b745d381e419.vsidx}
RENAMED
File without changes
|
.vs/UBCFProductRecommendations/v17/.wsuo
CHANGED
Binary files a/.vs/UBCFProductRecommendations/v17/.wsuo and b/.vs/UBCFProductRecommendations/v17/.wsuo differ
|
|
app.py
CHANGED
@@ -4,7 +4,10 @@ import gradio as gr
|
|
4 |
|
5 |
def recommend_items(customer_id_1, customer_id_2):
|
6 |
# Read data source Excel file.
|
7 |
-
|
|
|
|
|
|
|
8 |
df1a = df1.dropna(subset=['CustomerID'])
|
9 |
|
10 |
# Create CustomerID vs Item (Purchased Items, " StockCode) matrix by pivot table function.
|
|
|
4 |
|
5 |
def recommend_items(customer_id_1, customer_id_2):
|
6 |
# Read data source Excel file.
|
7 |
+
try:
|
8 |
+
df1 = pd.read_excel("UBCF_Online_Retail.xlsx")
|
9 |
+
except FileNotFoundError:
|
10 |
+
return "Error: Excel file not found."
|
11 |
df1a = df1.dropna(subset=['CustomerID'])
|
12 |
|
13 |
# Create CustomerID vs Item (Purchased Items, " StockCode) matrix by pivot table function.
|