File tree Expand file tree Collapse file tree 2 files changed +3
-5
lines changed
Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Original file line number Diff line number Diff line change 55from __future__ import annotations
66
77from collections import abc
8+ from itertools import pairwise
89import types
910from typing import (
1011 TYPE_CHECKING ,
@@ -417,13 +418,11 @@ def concat(
417418 if (
418419 intersect
419420 or any (not isinstance (index , DatetimeIndex ) for index in non_concat_axis )
420- or all (
421- prev is curr for prev , curr in zip (non_concat_axis , non_concat_axis [1 :])
422- )
421+ or all (prev is curr for prev , curr in pairwise (non_concat_axis ))
423422 or (
424423 all (
425424 prev [- 1 ] <= curr [0 ] and prev .is_monotonic_increasing
426- for prev , curr in zip (non_concat_axis , non_concat_axis [ 1 :] )
425+ for prev , curr in pairwise (non_concat_axis )
427426 if not prev .empty and not curr .empty
428427 )
429428 and non_concat_axis [- 1 ].is_monotonic_increasing
Original file line number Diff line number Diff line change @@ -453,7 +453,6 @@ exclude = [
453453"pandas/core/groupby/grouper.py" = [" B905" ]
454454"pandas/core/groupby/ops.py" = [" B905" ]
455455"pandas/core/methods/to_dict.py" = [" B905" ]
456- "pandas/core/reshape/concat.py" = [" B905" ]
457456"pandas/core/reshape/encoding.py" = [" B905" ]
458457"pandas/core/reshape/melt.py" = [" B905" ]
459458"pandas/core/reshape/merge.py" = [" B905" ]
You can’t perform that action at this time.
0 commit comments