A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/pandas-dev/pandas/issues/13395 below:

Index.unique() should always return an Index object of the same type · Issue #13395 · pandas-dev/pandas · GitHub

This should also be noted in the docstring for the method.

Currently, it sometimes returns numpy arrays:

>>> pd.DatetimeIndex(['2000-01-01', '2000-01-02']).unique()
DatetimeIndex(['2000-01-01', '2000-01-02'], dtype='datetime64[ns]', freq=None)

>>> pd.Index([0, 1, 2]).unique()
array([0, 1, 2])

Most of the work here is probably writing comprehensive tests to check each index type.

xref: https://github.com/pydata/pandas/pull/13361/files/17209f92330c5e949934aec9dea039b35faf6e40#r66179418


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4