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.
Python Pandas has low CPU usage and not using all cores
Pandas Set on copy warning when using .loc
Merge very large csv using pandas or awk
seasonal_decompose: operands could not be broadcast together with shapes on a series
How to properly sample from a numpy.random.multivariate_normal (positive-semidefinite covariance matrix issue)
how to do logical operation between dataframe columns?
Console hangs up at the time of plotting
Pandas apply a function at fixed interval
float type column in pandas to convert to tuple/list
Getting an error with Pandas Panel boolean indexing
pandas dataframe subtraction causing nan
Pandas dataframe: truncate string fields
how to add new categorical column in pandas
Finding different Ids with the same value in pandas dataframe
Why can't iterrows do math - and instead returns integer values where these should be floats
How to merge/concatenate based on column multiindex? (Pandas)