antfraia commited on
Commit
b1d35e5
·
1 Parent(s): 54a434a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -35,9 +35,12 @@ if website_name:
35
  # Formatting and displaying all the data in Streamlit table
36
  table_data = {}
37
  for key, value in google_maps_data.items():
38
- # Handle lists
39
- if isinstance(value, list):
40
  table_data[key] = ", ".join(value)
 
 
 
41
  # Handle nested dictionaries
42
  elif isinstance(value, dict):
43
  table_data[key] = ", ".join([f"{k}: {v}" for k, v in value.items()])
 
35
  # Formatting and displaying all the data in Streamlit table
36
  table_data = {}
37
  for key, value in google_maps_data.items():
38
+ # Handle lists of strings
39
+ if isinstance(value, list) and all(isinstance(item, str) for item in value):
40
  table_data[key] = ", ".join(value)
41
+ # Handle lists of dictionaries
42
+ elif isinstance(value, list) and all(isinstance(item, dict) for item in value):
43
+ table_data[key] = ", ".join([str(item) for item in value])
44
  # Handle nested dictionaries
45
  elif isinstance(value, dict):
46
  table_data[key] = ", ".join([f"{k}: {v}" for k, v in value.items()])