|
4 | 4 | import numpy as np |
5 | 5 | from pandas.compat import zip |
6 | 6 |
|
7 | | -from pandas import (DataFrame, Series, isna, to_datetime, DatetimeIndex, |
| 7 | +from pandas import (DataFrame, Series, isna, to_datetime, DatetimeIndex, Index, |
8 | 8 | Timestamp, Interval, IntervalIndex, Categorical, |
9 | 9 | cut, qcut, date_range, NaT, TimedeltaIndex) |
10 | 10 | from pandas.tseries.offsets import Nano, Day |
@@ -105,10 +105,12 @@ def test_cut_corner(self): |
105 | 105 | pytest.raises(ValueError, cut, [1, 2, 3], 0.5) |
106 | 106 |
|
107 | 107 | @pytest.mark.parametrize('arg', [2, np.eye(2), DataFrame(np.eye(2))]) |
| 108 | + @pytest.mark.parametrize('bins', [2, np.array(2), np.arange(1, 2), [1, 2], |
| 109 | + Series([1, 2]), Index([1, 2])]) |
108 | 110 | @pytest.mark.parametrize('cut_func', [cut, qcut]) |
109 | | - def test_cut_not_1d_arg(self, arg, cut_func): |
| 111 | + def test_cut_not_1d_arg(self, arg, bins, cut_func): |
110 | 112 | with pytest.raises(ValueError): |
111 | | - cut_func(arg, 2) |
| 113 | + cut_func(arg, bins) |
112 | 114 |
|
113 | 115 | def test_cut_out_of_range_more(self): |
114 | 116 | # #1511 |
|
0 commit comments