Skip to content

Commit 8f64123

Browse files
committed
Rolling back changes to modified test
1 parent e126877 commit 8f64123

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

pandas/core/indexes/interval.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1420,17 +1420,17 @@ def interval_range(
14201420
dtype: np.dtype = np.dtype("int64")
14211421
if com.all_not_none(start, end, freq):
14221422
if (
1423-
isinstance(start, (float, np.floating))
1424-
or isinstance(end, (float, np.floating))
1425-
or isinstance(freq, (float, np.floating))
1426-
):
1427-
dtype = np.dtype("float64")
1428-
elif (
14291423
isinstance(start, (np.integer, np.floating))
14301424
and isinstance(end, (np.integer, np.floating))
14311425
and start.dtype == end.dtype
14321426
):
14331427
dtype = start.dtype
1428+
elif (
1429+
isinstance(start, (float, np.floating))
1430+
or isinstance(end, (float, np.floating))
1431+
or isinstance(freq, (float, np.floating))
1432+
):
1433+
dtype = np.dtype("float64")
14341434
# 0.1 ensures we capture end
14351435
breaks = np.arange(start, end + (freq * 0.1), freq)
14361436
breaks = maybe_downcast_numeric(breaks, dtype)

pandas/tests/indexes/interval/test_interval_range.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ def test_float_subtype(self, start, end, freq):
225225
[
226226
(np.int8(1), np.int8(10), np.dtype("int8")),
227227
(np.int8(1), np.float16(10), np.dtype("float64")),
228-
(np.float32(1), np.float32(10), np.dtype("float64")),
228+
(np.float32(1), np.float32(10), np.dtype("float32")),
229229
(1, 10, np.dtype("int64")),
230230
(1, 10.0, np.dtype("float64")),
231231
],

0 commit comments

Comments
 (0)