mirror of
https://github.com/fjosw/pyerrors.git
synced 2025-05-14 19:43:41 +02:00
fix: redundant export of not gzipped pandas Dataframe removed.
This commit is contained in:
parent
153cc795b8
commit
c6ec11045c
1 changed files with 5 additions and 3 deletions
|
@ -30,10 +30,12 @@ def dump_df(df, fname, gz=True):
|
|||
if not fname.endswith('.csv'):
|
||||
fname += '.csv'
|
||||
|
||||
out.to_csv(fname, index=False)
|
||||
if gz is True:
|
||||
with open(fname, 'rb') as f_in, gzip.open(fname + ".gz", 'wb') as f_out:
|
||||
f_out.writelines(f_in)
|
||||
if not fname.endswith('.gz'):
|
||||
fname += '.gz'
|
||||
out.to_csv(fname, index=False, compression='gzip')
|
||||
else:
|
||||
out.to_csv(fname, index=False)
|
||||
|
||||
|
||||
def load_df(fname, auto_gamma=False, gz=True):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue