File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
pandas/tests/series/methods Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change 44import pytest
55
66from pandas .errors import OutOfBoundsDatetime
7-
87import pandas as pd
98from pandas import (
109 Series ,
@@ -155,3 +154,18 @@ def test_clip_with_timestamps_and_oob_datetimes_non_nano(self):
155154 expected = Series ([lower , upper ], dtype = dtype )
156155
157156 tm .assert_series_equal (result , expected )
157+
158+ def test_clip_with_scalar_numpy_array_lower ():
159+ s = pd .Series ([- 1 , 2 , 3 ])
160+ result = s .clip (lower = np .array (0 ))
161+ expected = pd .Series ([0 , 2 , 3 ])
162+ tm .assert_series_equal (result , expected )
163+
164+ def test_clip_with_scalar_numpy_array_upper ():
165+ s = pd .Series ([- 1 , 2 , 3 ])
166+ result = s .clip (upper = np .array (2 ))
167+ expected = pd .Series ([- 1 , 2 , 2 ])
168+ tm .assert_series_equal (result , expected )
169+
170+
171+
You can’t perform that action at this time.
0 commit comments