We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 30f5435 commit d260890Copy full SHA for d260890
tables2json.py
@@ -25,6 +25,9 @@ def get_tables(tables_dir):
25
all_celltags = {}
26
for metadata_filename in tables_dir.glob("1509*/metadata.json"):
27
metadata = get_metadata(metadata_filename)
28
+ for k in metadata:
29
+ if metadata[k] is None:
30
+ metadata[k] = ''
31
basedir = metadata_filename.parent
32
arxiv_id = basedir.name
33
all_metadata[arxiv_id] = metadata
@@ -34,6 +37,8 @@ def get_tables(tables_dir):
34
37
35
38
def t2j(df):
36
39
rows, cols = df.shape
40
+ if rows == 0 or cols == 0:
41
+ return [[""]]
42
return [[df.iloc[r, c] for c in range(cols)] for r in range(rows)]
43
44
0 commit comments