Skip to content

Commit

Permalink
Update table_conversion.py
Browse files Browse the repository at this point in the history
revert to related_pages from topics
  • Loading branch information
PatCapon39 authored May 6, 2024
1 parent 1450f93 commit c0b259a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions scripts/table_conversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@
# --------- Converting the table ---------

print(f"----> Converting google table to {output_path} started.")
resource_table = pd.read_csv(url, dtype={'name': str, 'url': str, 'description': str, 'topics': str, 'type': str, 'provider': str})
resource_table = pd.read_csv(url, dtype={'name': str, 'url': str, 'description': str, 'related_pages': str, 'type': str, 'provider': str})
resource_list = resource_table.to_dict("records")
clean_resource_list = []
for resource in resource_list:
if not pd.isna(resource['topics']):
category_list = resource['topics'].rsplit(sep=", ")
if not pd.isna(resource['related_pages']):
category_list = resource['related_pages'].rsplit(sep=", ")
else:
category_list = ""
# registry_dict = {}
Expand All @@ -35,7 +35,7 @@
clean_resource_list.append(clean_resource)
# clean_resource['registry'] = registry_dict
if category_list != "":
clean_resource['topics'] = category_list
clean_resource['related_pages'] = category_list

print(os.getcwd())
with open(output_path, 'w+') as yaml_file:
Expand Down

0 comments on commit c0b259a

Please sign in to comment.