As already mentioned in the documentation , Panel is currently a little underdeveloped, so the sweet syntax you came up with relies on working with the DataFrame yet.
Meanwhile, I would suggest using the Panel.select method:
def is_good_result(item_label):
The is_good_result function returns a boolean value. Note that its argument is not an instance of the DataFrame , because Panel.select applies its argument to the label of the element, and not to the contents of the DataFrame this element.
Of course, you can fill the entire criterion function in lambda in one statement if you go in all brevity:
good_results = results.select( lambda item_label: results[item_label]['col1'].sum() > 5 )
olebebo
source share