Skip to content

Commit e5bca9f

Browse files
author
Sylvain MARIE
committed
Reverted debugging asserts and applied fix for numpy repeat from pandas-dev#47670.
1 parent 65c3a1d commit e5bca9f

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

pandas/_libs/arrays.pyx

+1-1
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ cdef class NDArrayBacked:
157157
return self._from_backing_data(res_values)
158158

159159
# TODO: pass NPY_MAXDIMS equiv to axis=None?
160-
def repeat(self, repeats, axis: int = 0):
160+
def repeat(self, repeats, axis = 0):
161161
if axis is None:
162162
axis = 0
163163
res_values = cnp.PyArray_Repeat(self._ndarray, repeats, <int>axis)

pandas/tests/extension/base/methods.py

-2
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,6 @@ def test_where_series(self, data, na_value, as_frame):
500500
@pytest.mark.parametrize("repeats", [0, 1, 2, [1, 2, 3]])
501501
def test_repeat(self, data, repeats, as_series, use_numpy):
502502
arr = type(data)._from_sequence(data[:3], dtype=data.dtype)
503-
assert type(arr) is type(data)
504503
if as_series:
505504
arr = pd.Series(arr)
506505

@@ -509,7 +508,6 @@ def test_repeat(self, data, repeats, as_series, use_numpy):
509508
repeats = [repeats] * 3 if isinstance(repeats, int) else repeats
510509
expected = [x for x, n in zip(arr, repeats) for _ in range(n)]
511510
expected = type(data)._from_sequence(expected, dtype=data.dtype)
512-
assert type(expected) is type(data)
513511
if as_series:
514512
expected = pd.Series(expected, index=arr.index.repeat(repeats))
515513

0 commit comments

Comments
 (0)