Pandas option to keep levels after xs operation
Is there a way to perform a cross-section on a hierarchical dataframe that returns the dataframe without the searched levels being dropped? That is, if you have a dataframe with index.names = ['month','year'] and perform the following command newdf = df.xs(('January'),level=('month')) such that the new dataframe retains the month index?
It seems that drop_level kwarg has been added to version 0.13 for this exact purpose.
Edit field and append value to a python dataframe column
column_stack returns non cotiguous array
pandas: conditionally select a row cell for each column based on a mask
pandas custom function apply on melted dataframe
How to check for boolean codition in pandas dataframe
Reading batches of data from BigQuery into Datalab
Jupyter/ipywidgets sorting dataframe on two levels
Groupby.sum() giving ValueError: overflow in timedelta operation
Why does DataFrameGroupBy.boxplot method throw error when given argument “subplots=True/False”?
Calculate age in months - optimize date transformations in pandas
pandas: list of dictionaries grouped by key from df
Pandas data frames and matplotlib.pyplot
Pandas.to_csv thousand separator
Annotating a graph with certain values of another series (Index is datetime)
Pandas rolling sum on string column
pandas apply() with and without lambda