-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Open
Labels
API - ConsistencyInternal Consistency of API/BehaviorInternal Consistency of API/BehaviorDtype ConversionsUnexpected or buggy dtype conversionsUnexpected or buggy dtype conversionsIndexRelated to the Index class or subclassesRelated to the Index class or subclassesRefactorInternal refactoring of codeInternal refactoring of codesetopsunion, intersection, difference, symmetric_differenceunion, intersection, difference, symmetric_difference
Description
ATM NumericIndex._union has special casting rules for what dtype it casts to when unioning with another NumericIndex of a different dtype.
# Right now, we treat union(int, float) a bit special.
# See https://github.com/pandas-dev/pandas/issues/26778 for discussion
# We may change union(int, float) to go to object.
# float | [u]int -> float (the special case)
# <T> | <T> -> T
# <T> | <U> -> object
Instead, we should re-use code (not sure where this lives, cc @jorisvandenbossche ?) from concat (maybe even Block.putmask?) to determing the appropriate upcast dtype.
Metadata
Metadata
Assignees
Labels
API - ConsistencyInternal Consistency of API/BehaviorInternal Consistency of API/BehaviorDtype ConversionsUnexpected or buggy dtype conversionsUnexpected or buggy dtype conversionsIndexRelated to the Index class or subclassesRelated to the Index class or subclassesRefactorInternal refactoring of codeInternal refactoring of codesetopsunion, intersection, difference, symmetric_differenceunion, intersection, difference, symmetric_difference