mirror of
https://github.com/fjosw/pyerrors.git
synced 2025-05-15 12:03:42 +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'):
|
if not fname.endswith('.csv'):
|
||||||
fname += '.csv'
|
fname += '.csv'
|
||||||
|
|
||||||
out.to_csv(fname, index=False)
|
|
||||||
if gz is True:
|
if gz is True:
|
||||||
with open(fname, 'rb') as f_in, gzip.open(fname + ".gz", 'wb') as f_out:
|
if not fname.endswith('.gz'):
|
||||||
f_out.writelines(f_in)
|
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):
|
def load_df(fname, auto_gamma=False, gz=True):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue