Skip to content

Commit 45407e6

Browse files
authored
Merge branch 'main' into bugfix-spss-kwargs
2 parents b5678f9 + 1b7bfed commit 45407e6

File tree

12 files changed

+179
-100
lines changed

12 files changed

+179
-100
lines changed

ci/code_checks.sh

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -294,34 +294,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
294294
-i "pandas.errors.UnsupportedFunctionCall SA01" \
295295
-i "pandas.errors.ValueLabelTypeMismatch SA01" \
296296
-i "pandas.infer_freq SA01" \
297-
-i "pandas.io.formats.style.Styler.apply RT03" \
298-
-i "pandas.io.formats.style.Styler.apply_index RT03" \
299-
-i "pandas.io.formats.style.Styler.background_gradient RT03" \
300-
-i "pandas.io.formats.style.Styler.bar RT03,SA01" \
301-
-i "pandas.io.formats.style.Styler.clear SA01" \
302-
-i "pandas.io.formats.style.Styler.concat RT03,SA01" \
303-
-i "pandas.io.formats.style.Styler.export RT03" \
304-
-i "pandas.io.formats.style.Styler.from_custom_template SA01" \
305-
-i "pandas.io.formats.style.Styler.hide RT03,SA01" \
306-
-i "pandas.io.formats.style.Styler.highlight_between RT03" \
307-
-i "pandas.io.formats.style.Styler.highlight_max RT03" \
308-
-i "pandas.io.formats.style.Styler.highlight_min RT03" \
309-
-i "pandas.io.formats.style.Styler.highlight_null RT03" \
310-
-i "pandas.io.formats.style.Styler.highlight_quantile RT03" \
311-
-i "pandas.io.formats.style.Styler.map RT03" \
312-
-i "pandas.io.formats.style.Styler.map_index RT03" \
313-
-i "pandas.io.formats.style.Styler.set_caption RT03,SA01" \
314-
-i "pandas.io.formats.style.Styler.set_properties RT03,SA01" \
315-
-i "pandas.io.formats.style.Styler.set_sticky RT03,SA01" \
316-
-i "pandas.io.formats.style.Styler.set_table_attributes PR07,RT03" \
317-
-i "pandas.io.formats.style.Styler.set_table_styles RT03" \
318-
-i "pandas.io.formats.style.Styler.set_td_classes RT03" \
319-
-i "pandas.io.formats.style.Styler.set_tooltips RT03,SA01" \
320-
-i "pandas.io.formats.style.Styler.set_uuid PR07,RT03,SA01" \
321-
-i "pandas.io.formats.style.Styler.text_gradient RT03" \
322-
-i "pandas.io.formats.style.Styler.to_excel PR01" \
323-
-i "pandas.io.formats.style.Styler.to_string SA01" \
324-
-i "pandas.io.formats.style.Styler.use RT03" \
325297
-i "pandas.io.json.build_table_schema PR07,RT03,SA01" \
326298
-i "pandas.io.stata.StataReader.data_label SA01" \
327299
-i "pandas.io.stata.StataReader.value_labels RT03,SA01" \

doc/source/whatsnew/v3.0.0.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,7 @@ Performance improvements
506506
- Performance improvement in :meth:`DataFrame.join` for sorted but non-unique indexes (:issue:`56941`)
507507
- Performance improvement in :meth:`DataFrame.join` when left and/or right are non-unique and ``how`` is ``"left"``, ``"right"``, or ``"inner"`` (:issue:`56817`)
508508
- Performance improvement in :meth:`DataFrame.join` with ``how="left"`` or ``how="right"`` and ``sort=True`` (:issue:`56919`)
509+
- Performance improvement in :meth:`DataFrame.to_csv` when ``index=False`` (:issue:`59312`)
509510
- Performance improvement in :meth:`DataFrameGroupBy.ffill`, :meth:`DataFrameGroupBy.bfill`, :meth:`SeriesGroupBy.ffill`, and :meth:`SeriesGroupBy.bfill` (:issue:`56902`)
510511
- Performance improvement in :meth:`Index.join` by propagating cached attributes in cases where the result matches one of the inputs (:issue:`57023`)
511512
- Performance improvement in :meth:`Index.take` when ``indices`` is a full range indexer from zero to length of index (:issue:`56806`)
@@ -555,6 +556,7 @@ Datetimelike
555556
- Bug in :meth:`DatetimeIndex.union` and :meth:`DatetimeIndex.intersection` when ``unit`` was non-nanosecond (:issue:`59036`)
556557
- Bug in :meth:`Series.dt.microsecond` producing incorrect results for pyarrow backed :class:`Series`. (:issue:`59154`)
557558
- Bug in :meth:`to_datetime` not respecting dayfirst if an uncommon date string was passed. (:issue:`58859`)
559+
- Bug in :meth:`to_datetime` reports incorrect index in case of any failure scenario. (:issue:`58298`)
558560
- Bug in setting scalar values with mismatched resolution into arrays with non-nanosecond ``datetime64``, ``timedelta64`` or :class:`DatetimeTZDtype` incorrectly truncating those scalars (:issue:`56410`)
559561

560562
Timedelta

pandas/_libs/tslib.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ cpdef array_to_datetime(
439439
raise TypeError(f"{type(val)} is not convertible to datetime")
440440

441441
except (TypeError, OverflowError, ValueError) as ex:
442-
ex.args = (f"{ex}, at position {i}",)
442+
ex.args = (f"{ex}",)
443443
if is_coerce:
444444
iresult[i] = NPY_NAT
445445
continue

pandas/_libs/tslibs/strptime.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@ def array_strptime(
536536

537537
except ValueError as ex:
538538
ex.args = (
539-
f"{str(ex)}, at position {i}. You might want to try:\n"
539+
f"{str(ex)}. You might want to try:\n"
540540
" - passing `format` if your strings have a consistent format;\n"
541541
" - passing `format='ISO8601'` if your strings are "
542542
"all ISO8601 but not necessarily in exactly the same format;\n"

pandas/core/generic.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2123,11 +2123,13 @@ def _repr_data_resource_(self):
21232123
klass="object",
21242124
storage_options=_shared_docs["storage_options"],
21252125
storage_options_versionadded="1.2.0",
2126+
encoding_parameter="",
2127+
verbose_parameter="",
21262128
extra_parameters=textwrap.dedent(
21272129
"""\
21282130
engine_kwargs : dict, optional
21292131
Arbitrary keyword arguments passed to excel engine.
2130-
"""
2132+
"""
21312133
),
21322134
)
21332135
def to_excel(
@@ -2196,9 +2198,11 @@ def to_excel(
21962198
21972199
merge_cells : bool, default True
21982200
Write MultiIndex and Hierarchical Rows as merged cells.
2201+
{encoding_parameter}
21992202
inf_rep : str, default 'inf'
22002203
Representation for infinity (there is no native representation for
22012204
infinity in Excel).
2205+
{verbose_parameter}
22022206
freeze_panes : tuple of int (length 2), optional
22032207
Specifies the one-based bottommost row and rightmost column that
22042208
is to be frozen.

pandas/io/formats/csvs.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,11 @@ def _save_chunk(self, start_i: int, end_i: int) -> None:
320320
res = df._get_values_for_csv(**self._number_format)
321321
data = list(res._iter_column_arrays())
322322

323-
ix = self.data_index[slicer]._get_values_for_csv(**self._number_format)
323+
ix = (
324+
self.data_index[slicer]._get_values_for_csv(**self._number_format)
325+
if self.nlevels != 0
326+
else np.empty(end_i - start_i)
327+
)
324328
libwriters.write_csv_rows(
325329
data,
326330
ix,

0 commit comments

Comments
 (0)