File tree Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -1990,20 +1990,20 @@ def _from_combined(self, combined: np.ndarray) -> IntervalArray:
1990
1990
return self ._shallow_copy (left = new_left , right = new_right )
1991
1991
1992
1992
def unique (self ) -> IntervalArray :
1993
- # Using .view("complex128") with negatives causes issues. # GH#61917
1994
- combined = self ._combined
1995
- combined = np .ascontiguousarray (combined )
1996
- if combined .dtype == np .object_ :
1993
+ # No overload variant of "__getitem__" of "ExtensionArray" matches argument
1994
+ # type "Tuple[slice, int]"
1995
+ if needs_i8_conversion (self ._left .dtype ):
1997
1996
nc = unique (
1998
1997
self ._combined .view ("complex128" )[:, 0 ] # type: ignore[call-overload]
1999
1998
)
2000
- nc = nc [:, None ]
2001
1999
else :
2002
- structured = combined .view (
2003
- [("left" , combined .dtype ), ("right" , combined .dtype )]
2004
- )[:, 0 ]
2005
- unique_structured = unique (structured )
2006
- nc = unique_structured .view (combined .dtype )
2000
+ nc = unique (
2001
+ # Using .view("complex128") with negatives causes issues.
2002
+ # GH#61917
2003
+ (np .array (self ._combined [:, 0 ], dtype = complex ))
2004
+ + (1j * np .array (self ._combined [:, 1 ], dtype = complex ))
2005
+ )
2006
+ nc = nc [:, None ]
2007
2007
return self ._from_combined (nc )
2008
2008
2009
2009
You can’t perform that action at this time.
0 commit comments