Skip to content

Commit 1218163

Browse files
Move new errors argument to the end
1 parent e0b6c47 commit 1218163

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

pandas/core/generic.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3035,7 +3035,6 @@ def to_csv(
30353035
index_label: Optional[Union[bool_t, str, Sequence[Label]]] = None,
30363036
mode: str = "w",
30373037
encoding: Optional[str] = None,
3038-
errors: str = "strict",
30393038
compression: Optional[Union[str, Mapping[str, str]]] = "infer",
30403039
quoting: Optional[int] = None,
30413040
quotechar: str = '"',
@@ -3045,6 +3044,7 @@ def to_csv(
30453044
doublequote: bool_t = True,
30463045
escapechar: Optional[str] = None,
30473046
decimal: Optional[str] = ".",
3047+
errors: str = "strict",
30483048
) -> Optional[str]:
30493049
r"""
30503050
Write object to a comma-separated values (csv) file.
@@ -3092,12 +3092,6 @@ def to_csv(
30923092
encoding : str, optional
30933093
A string representing the encoding to use in the output file,
30943094
defaults to 'utf-8'.
3095-
errors : str, default 'strict'
3096-
Specifies how encoding and decoding errors are to be handled.
3097-
See the errors argument for :func:`open` for a full list
3098-
of options.
3099-
3100-
.. versionadded:: 1.1.0
31013095
compression : str or dict, default 'infer'
31023096
If str, represents compression mode. If dict, value at 'method' is
31033097
the compression mode. Compression mode may be any of the following
@@ -3145,6 +3139,12 @@ def to_csv(
31453139
decimal : str, default '.'
31463140
Character recognized as decimal separator. E.g. use ',' for
31473141
European data.
3142+
errors : str, default 'strict'
3143+
Specifies how encoding and decoding errors are to be handled.
3144+
See the errors argument for :func:`open` for a full list
3145+
of options.
3146+
3147+
.. versionadded:: 1.1.0
31483148
31493149
Returns
31503150
-------

pandas/io/common.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -330,10 +330,10 @@ def get_handle(
330330
path_or_buf,
331331
mode: str,
332332
encoding=None,
333-
errors=None,
334333
compression: Optional[Union[str, Mapping[str, Any]]] = None,
335334
memory_map: bool = False,
336335
is_text: bool = True,
336+
errors=None,
337337
):
338338
"""
339339
Get file handle for given path/buffer and mode.
@@ -346,12 +346,6 @@ def get_handle(
346346
Mode to open path_or_buf with.
347347
encoding : str or None
348348
Encoding to use.
349-
errors : str, default 'strict'
350-
Specifies how encoding and decoding errors are to be handled.
351-
See the errors argument for :func:`open` for a full list
352-
of options.
353-
354-
.. versionadded:: 1.1.0
355349
compression : str or dict, default None
356350
If string, specifies compression mode. If dict, value at key 'method'
357351
specifies compression mode. Compression mode must be one of {'infer',
@@ -378,6 +372,12 @@ def get_handle(
378372
is_text : boolean, default True
379373
whether file/buffer is in text format (csv, json, etc.), or in binary
380374
mode (pickle, etc.).
375+
errors : str, default 'strict'
376+
Specifies how encoding and decoding errors are to be handled.
377+
See the errors argument for :func:`open` for a full list
378+
of options.
379+
380+
.. versionadded:: 1.1.0
381381
382382
Returns
383383
-------

0 commit comments

Comments
 (0)