using this example you have a 2 level index whereby you are then calling market data, originally the indexer was ['price'] which was causing errors and non-explicit. using the .xs makes it much clearer and also functional.
pd.TimeGrouper has been deprecated and has been replaced by pd.Grouper, the parameter remains the same of 'D' for pd.Grouper(freq='D')
the capacity tearsheet had several errors when following the format of market_data as found in the /pyfolio/tests
using this example you have a 2 level index whereby you are then calling market data, originally the indexer was ['price'] which was causing errors and non-explicit. using the .xs makes it much clearer and also functional.
pd.TimeGrouper has been deprecated and has been replaced by pd.Grouper, the parameter remains the same of
'D'
for pd.Grouper(freq='D')