Skip to content

CLN: implement xs in terms of loc #6249

Closed
@jreback

Description

after #6134 we can drop xs and implement directly. Thus we should deprecate it.

.xs(key, level=n)

is roughly equivalent to this

indexer = tuple([slice(None)]*(n-1) + key)]
axis_indexer = [ slice(None) ] * self.ndim
axis_indexer[axis] = indexer
self.loc[tuple(axis_indexer)]

roughly because needs to handle .xs full argument set

  • drop_level (need to surround the indexer tuple with a list or not)
  • n could be a level name
  • n = 1 (needs a test)

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions