Spaces:
Build error
Build error
Commit ·
475a4a4
1
Parent(s): 69983c5
Update weaviate_utils.py
Browse files26 unmodified lines2728293031323334353637383926 unmodified linesreturn resultsdef convert_to_tapas_format(data):"""Convert the list of dictionaries (from Weaviate) into the format TAPAS expects.Return the table as a list of lists."""df = pd.DataFrame(data)table = [df.columns.tolist()] + df.values.tolist()return table26 unmodified lines272829303132333435363738394041424326 unmodified linesreturn resultsdef convert_to_tapas_format(data):"""Convert the list of dictionaries (from Weaviate) into the format TAPAS expects.Return the table as a list of lists."""# Extract the data objects from the resultsdata_objects = data.get('data', {}).get('Get', {}).get('Things', [])# Convert the data objects into a DataFramedf = pd.DataFrame([obj['thing'] for obj in data_objects])table = [df.columns.tolist()] + df.values.tolist()return table
weaviate_utils.py+6-2