File tree Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -1992,13 +1992,18 @@ def _from_combined(self, combined: np.ndarray) -> IntervalArray:
19921992 def unique (self ) -> IntervalArray :
19931993 # Using .view("complex128") with negatives causes issues. # GH#61917
19941994 combined = self ._combined
1995- if not combined .flags .c_contiguous :
1996- combined = np .ascontiguousarray (combined )
1997- structured = combined .view (
1998- [("left" , combined .dtype ), ("right" , combined .dtype )]
1999- )[:, 0 ]
2000- unique_structured = unique (structured )
2001- nc = unique_structured .view (combined .dtype )
1995+ combined = np .ascontiguousarray (combined )
1996+ if combined .dtype == np .object_ :
1997+ nc = unique (
1998+ self ._combined .view ("complex128" )[:, 0 ] # type: ignore[call-overload]
1999+ )
2000+ nc = nc [:, None ]
2001+ 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 )
20022007 return self ._from_combined (nc )
20032008
20042009
You can’t perform that action at this time.
0 commit comments