Spaces:
Sleeping
Sleeping
LeireTedCas
commited on
Commit
•
c2435f8
1
Parent(s):
6620894
Update app.py
Browse files
app.py
CHANGED
@@ -20,15 +20,24 @@ base_url ='https://orva.tedcas.com/api/'#line:21
|
|
20 |
archivo ="./preguntas_qh_tags.xlsx"#line:22
|
21 |
xlrd .xlsx .ensure_elementtree_imported (False ,None )#line:25
|
22 |
xlrd .xlsx .Element_has_iter =True #line:26
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
async def faq ():#line:28
|
24 |
-
OO0000OO00O0OOO00 =pd .read_excel (archivo ,engine ="openpyxl"
|
|
|
25 |
OOOO000OOO0OO0O0O =OO0000OO00O0OOO00 #line:30
|
26 |
OO0000OO00O0OOO00 =xlrd .open_workbook (archivo )#line:31
|
27 |
OO0000OO00O0OOO00 =OO0000OO00O0OOO00 .sheet_by_index (0 )#line:32
|
28 |
O0000OO00OO0OO000 =[]#line:33
|
29 |
OOOO0O00O000OOO00 =[]#line:34
|
30 |
OOOO0O000000O0000 =[]#line:35
|
31 |
-
OOO0O00OOO000OO00 =pd .read_excel (archivo ,header =1
|
|
|
32 |
for O0OO00O000OO0O0OO ,OO0000O0O00000O0O in OOO0O00OOO000OO00 .iterrows ():#line:37
|
33 |
if OOOO000OOO0OO0O0O .loc [O0OO00O000OO0O0OO ,'Especialidad']=='trauma':#line:38
|
34 |
O0OOO00O0O0000O0O =OO0000OO00O0OOO00 .cell (int (O0OO00O000OO0O0OO )+1 ,2 )#line:39
|
@@ -58,7 +67,8 @@ async def faq ():#line:28
|
|
58 |
break #line:63
|
59 |
return O0000OO00OO0OO000 ,OOOO0O00O000OOO00 ,OOOO0O000000O0000 #line:64
|
60 |
async def buscar_faq (OOO0O0O0OOOO000OO ,O0OOOOO00OO0000O0 ):#line:66
|
61 |
-
O00OO0O00O000O00O =pd .read_excel (archivo ,engine ="openpyxl"
|
|
|
62 |
O0OOOOO0OO0OO0000 =O00OO0O00O000O00O #line:68
|
63 |
OO00OO0O000OO0O00 =0 #line:69
|
64 |
O000O00O00O0OO0OO =OOO0O0O0OOOO000OO #line:70
|
|
|
20 |
archivo ="./preguntas_qh_tags.xlsx"#line:22
|
21 |
xlrd .xlsx .ensure_elementtree_imported (False ,None )#line:25
|
22 |
xlrd .xlsx .Element_has_iter =True #line:26
|
23 |
+
|
24 |
+
# Función para eliminar caracteres no imprimibles
|
25 |
+
def remove_non_printable(char):
|
26 |
+
if ord(char) < 32 or ord(char) > 126:
|
27 |
+
return ''
|
28 |
+
return char
|
29 |
+
|
30 |
async def faq ():#line:28
|
31 |
+
OO0000OO00O0OOO00 =pd .read_excel (archivo ,engine ="openpyxl")#line:29
|
32 |
+
OO0000OO00O0OOO00 = OO0000OO00O0OOO00.applymap(remove_non_printable)
|
33 |
OOOO000OOO0OO0O0O =OO0000OO00O0OOO00 #line:30
|
34 |
OO0000OO00O0OOO00 =xlrd .open_workbook (archivo )#line:31
|
35 |
OO0000OO00O0OOO00 =OO0000OO00O0OOO00 .sheet_by_index (0 )#line:32
|
36 |
O0000OO00OO0OO000 =[]#line:33
|
37 |
OOOO0O00O000OOO00 =[]#line:34
|
38 |
OOOO0O000000O0000 =[]#line:35
|
39 |
+
OOO0O00OOO000OO00 =pd .read_excel (archivo ,header =1)#line:36
|
40 |
+
OOO0O00OOO000OO00 = OOO0O00OOO000OO00.applymap(remove_non_printable)
|
41 |
for O0OO00O000OO0O0OO ,OO0000O0O00000O0O in OOO0O00OOO000OO00 .iterrows ():#line:37
|
42 |
if OOOO000OOO0OO0O0O .loc [O0OO00O000OO0O0OO ,'Especialidad']=='trauma':#line:38
|
43 |
O0OOO00O0O0000O0O =OO0000OO00O0OOO00 .cell (int (O0OO00O000OO0O0OO )+1 ,2 )#line:39
|
|
|
67 |
break #line:63
|
68 |
return O0000OO00OO0OO000 ,OOOO0O00O000OOO00 ,OOOO0O000000O0000 #line:64
|
69 |
async def buscar_faq (OOO0O0O0OOOO000OO ,O0OOOOO00OO0000O0 ):#line:66
|
70 |
+
O00OO0O00O000O00O =pd .read_excel (archivo ,engine ="openpyxl")#line:67
|
71 |
+
O00OO0O00O000O00O = O00OO0O00O000O00O.applymap(remove_non_printable)
|
72 |
O0OOOOO0OO0OO0000 =O00OO0O00O000O00O #line:68
|
73 |
OO00OO0O000OO0O00 =0 #line:69
|
74 |
O000O00O00O0OO0OO =OOO0O0O0OOOO000OO #line:70
|