Skip to content

Commit

Permalink
Exclude index when writing parquet from pandas. (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
srgk26 authored Feb 6, 2023
1 parent 1da768b commit d9959c5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion abstar/utils/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,7 @@ def write_output(output_dict, output_dir, output_prefix, write_parquet: bool):
dtypes = get_parquet_dtypes(fmt)
df = pd.DataFrame.from_records([json.loads(line) for line in output_dict[fmt]])
df = df.reindex(columns=dtypes).astype(dtypes)
df.to_parquet(output_file, engine="pyarrow", compression="snappy", schema=schema)
df.to_parquet(output_file, index=False, engine="pyarrow", compression="snappy", schema=schema)
else:
output_name = output_prefix + get_output_suffix(fmt)
output_file = os.path.join(subdir, output_name)
Expand Down

0 comments on commit d9959c5

Please sign in to comment.