BUG: Series/Index arithmetic result names with NAs by jbrockmendel · Pull Request #44459 · pandas-dev/pandas (original) (raw)
Certainly no objection to the modification here, but I do wonder if we should be changing the API to narrow what is allowed as a Series name or DataFrame label. For example, from #39757,
series_a = Series([1,2,3], name=np.float64(1.0))
series_b = Series([1,2,3], name=(np.float64(1.0), np.float64(2.0)))
pd.concat([series_a, series_b], axis=1).columns.sort_values()
still fails. I am wondering if we should change the API to only allow basic primitive types (Boolean, int, str, float?, perhaps some others) and tuples of primitive types, rather than trying to chase these issues down.