ENH/CLN: Add factorize to IndexOpsMixin by sinhrks · Pull Request #7090 · pandas-dev/pandas (original) (raw)
As pointed in #7041, I prepared a PR to add factorize to IndexOpsMixin.
As a side benefit, Multiindex.from_arrays can preserve original DatetimeIndex.freq and tz. (Related to #3950 and #6606. These issues are not solved yet because these use different methods to create MultiIndex).
I would like to confirm following points before adding more tests.
- What
Index.factorizeandSeries.factorizeshould return as unique values,ndarrayorIndex? I think it should returnIndexto preserveDatetimeIndexattributes (freqandtz). - Is this should be added to
api.rst?