Skip to content

Commit 55e6dbf

Browse files
Move new errors argument to the end
1 parent 1030f6c commit 55e6dbf

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
@@ -3040,7 +3040,6 @@ def to_csv(
30403040
index_label: Optional[Union[bool_t, str, Sequence[Label]]] = None,
30413041
mode: str = "w",
30423042
encoding: Optional[str] = None,
3043-
errors: str = "strict",
30443043
compression: Optional[Union[str, Mapping[str, str]]] = "infer",
30453044
quoting: Optional[int] = None,
30463045
quotechar: str = '"',
@@ -3050,6 +3049,7 @@ def to_csv(
30503049
doublequote: bool_t = True,
30513050
escapechar: Optional[str] = None,
30523051
decimal: Optional[str] = ".",
3052+
errors: str = "strict",
30533053
) -> Optional[str]:
30543054
r"""
30553055
Write object to a comma-separated values (csv) file.
@@ -3097,12 +3097,6 @@ def to_csv(
30973097
encoding : str, optional
30983098
A string representing the encoding to use in the output file,
30993099
defaults to 'utf-8'.
3100-
errors : str, default 'strict'
3101-
Specifies how encoding and decoding errors are to be handled.
3102-
See the errors argument for :func:`open` for a full list
3103-
of options.
3104-
3105-
.. versionadded:: 1.1.0
31063100
compression : str or dict, default 'infer'
31073101
If str, represents compression mode. If dict, value at 'method' is
31083102
the compression mode. Compression mode may be any of the following
@@ -3150,6 +3144,12 @@ def to_csv(
31503144
decimal : str, default '.'
31513145
Character recognized as decimal separator. E.g. use ',' for
31523146
European data.
3147+
errors : str, default 'strict'
3148+
Specifies how encoding and decoding errors are to be handled.
3149+
See the errors argument for :func:`open` for a full list
3150+
of options.
3151+
3152+
.. versionadded:: 1.1.0
31533153
31543154
Returns
31553155
-------

pandas/io/common.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -349,10 +349,10 @@ def get_handle(
349349
path_or_buf,
350350
mode: str,
351351
encoding=None,
352-
errors=None,
353352
compression: Optional[Union[str, Mapping[str, Any]]] = None,
354353
memory_map: bool = False,
355354
is_text: bool = True,
355+
errors=None,
356356
):
357357
"""
358358
Get file handle for given path/buffer and mode.
@@ -365,12 +365,6 @@ def get_handle(
365365
Mode to open path_or_buf with.
366366
encoding : str or None
367367
Encoding to use.
368-
errors : str, default 'strict'
369-
Specifies how encoding and decoding errors are to be handled.
370-
See the errors argument for :func:`open` for a full list
371-
of options.
372-
373-
.. versionadded:: 1.1.0
374368
compression : str or dict, default None
375369
If string, specifies compression mode. If dict, value at key 'method'
376370
specifies compression mode. Compression mode must be one of {'infer',
@@ -397,6 +391,12 @@ def get_handle(
397391
is_text : boolean, default True
398392
whether file/buffer is in text format (csv, json, etc.), or in binary
399393
mode (pickle, etc.).
394+
errors : str, default 'strict'
395+
Specifies how encoding and decoding errors are to be handled.
396+
See the errors argument for :func:`open` for a full list
397+
of options.
398+
399+
.. versionadded:: 1.1.0
400400
401401
Returns
402402
-------

0 commit comments

Comments
 (0)