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:
19901990 return self ._shallow_copy (left = new_left , right = new_right )
19911991
19921992 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 ):
19971996 nc = unique (
19981997 self ._combined .view ("complex128" )[:, 0 ] # type: ignore[call-overload]
19991998 )
2000- nc = nc [:, None ]
20011999 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 ]
20072007 return self ._from_combined (nc )
20082008
20092009
You can’t perform that action at this time.
0 commit comments