Skip to content

Commit 051dc3b

Browse files
committed
CLN: Use deprecate_kwarg to deprecate kwargs
1 parent 1cd7ae0 commit 051dc3b

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

pandas/core/series.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -2878,6 +2878,7 @@ def from_csv(cls, path, sep=',', parse_dates=True, header=None,
28782878

28792879
return result
28802880

2881+
@deprecate_kwarg(old_arg_name='path', new_arg_name='path_or_buf')
28812882
def to_csv(self, path_or_buf=None, index=True, sep=",", na_rep='',
28822883
float_format=None, header=False, index_label=None,
28832884
mode='w', encoding=None, compression=None, date_format=None,
@@ -2936,8 +2937,6 @@ def to_csv(self, path_or_buf=None, index=True, sep=",", na_rep='',
29362937

29372938
# convert to DataFrame
29382939
df = self.to_frame()
2939-
# ensure backwards compatibility with path argument
2940-
path_or_buf = kwargs.pop('path', path_or_buf)
29412940
# result is only a string if no path_or_buf provided, otherwise None
29422941
result = df.to_csv(path_or_buf, index=index, sep=sep, na_rep=na_rep,
29432942
float_format=float_format, header=header,

0 commit comments

Comments
 (0)