Skip to content

Commit 94ea0b2

Browse files
author
y-p
committed
CLN: change to_csv 'legacy' keyword to engine=='python', consistent with c_parser
1 parent 8988c65 commit 94ea0b2

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

pandas/core/format.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -769,8 +769,9 @@ class CSVFormatter(object):
769769
def __init__(self, obj, path_or_buf, sep=",", na_rep='', float_format=None,
770770
cols=None, header=True, index=True, index_label=None,
771771
mode='w', nanRep=None, encoding=None, quoting=None,
772-
line_terminator='\n', chunksize=None,legacy=False):
773-
self.legacy=legacy # remove for 0.12
772+
line_terminator='\n', chunksize=None, engine=None):
773+
774+
self.engine = engine # remove for 0.12
774775
self.obj = obj
775776
self.path_or_buf = path_or_buf
776777
self.sep = sep
@@ -927,7 +928,7 @@ def save(self):
927928
self.writer = csv.writer(f, lineterminator=self.line_terminator,
928929
delimiter=self.sep, quoting=self.quoting)
929930

930-
if self.legacy:
931+
if self.engine == 'python':
931932
# to be removed in 0.12
932933
self._helper_csv(self.writer, na_rep=self.na_rep,
933934
float_format=self.float_format, cols=self.cols,

pandas/core/frame.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1347,7 +1347,7 @@ def to_csv(self, path_or_buf, sep=",", na_rep='', float_format=None,
13471347
float_format=float_format, cols=cols,
13481348
header=header, index=index,
13491349
index_label=index_label,
1350-
chunksize=chunksize,legacy=kwds.get("legacy",False) )
1350+
chunksize=chunksize,engine=kwds.get("engine") )
13511351
formatter.save()
13521352

13531353
def to_excel(self, excel_writer, sheet_name='sheet1', na_rep='',

0 commit comments

Comments
 (0)