Skip to content

API/DEPR: casting bool-indexer to slice in dt64/td64/period #36210

Closed
@jbrockmendel

Description

@jbrockmendel

We use special logic for dt64/td64/period dtypes that makes view/copy behavior different from other dtypes:

dti = pd.date_range("2016-01-01", periods=4, tz="US/Pacific")
key = np.array([True, True, False, False])

ser1 = pd.Series(dti._data)
ser2 = pd.Series(range(4))

res1 = ser1[key]
res2 = ser2[key]

>>> res1._values._data.base is None
False
>>> res2._values.base is None
True

cc @jorisvandenbossche IIRC you advocated not doing this special casing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions