Skip to content

COMPAT: empty IntervalIndexis np.int64 dtype #19106

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 7, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pandas/core/indexes/interval.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def maybe_convert_platform_interval(values):
# GH 19016
# empty lists/tuples get object dtype by default, but this is not
# prohibited for IntervalIndex, so coerce to integer instead
return np.array([], dtype=np.intp)
return np.array([], dtype=np.int64)
return maybe_convert_platform(values)


Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/indexes/interval/test_interval.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def test_constructors_nan(self, closed, data):
np.array([], dtype='datetime64[ns]')])
def test_constructors_empty(self, data, closed):
# GH 18421
expected_dtype = getattr(data, 'dtype', np.intp)
expected_dtype = getattr(data, 'dtype', np.int64)
expected_values = np.array([], dtype=object)
expected_index = IntervalIndex(data, closed=closed)

Expand Down