pydata/pandas — pull request #4180 by hayd (2013-07-09 17:24:54+00:00)
Title: ENH drop_selected_levels argument for xs

As discussed [here](http://stackoverflow.com/questions/17552997/how-to-update-a-subset-of-a-multiindexed-pandas-dataframe), xs usually remove the level which you are accessing. This commit allows you to explicitly say you don't want that (and want to keep the same levels in the result).
```
In [4]: df = DataFrame({'day': {0: 'sat', 1: 'sun'},
'flavour': {0: 'strawberry', 1: 'strawberry'},
'sales': {0: 10, 1: 12},
'year': {0: 2008, 1: 2008}}).set_index(['year','flavour','day'])

In [5]: df
Out[5]:
sales
year flavour day
2008 strawberry sat 10
sun 12

In [6]: df.xs('sat', level='day')
Out[6]:
sales
year flavour
2008 strawberry 10

In [7]: df.xs('sat', level='day', drop_selected_level=False)
Out[7]:
sales
year flavour day
2008 strawberry sat 10
```