Question

What is the preferred way to iterate over all the items (which are dataframes) in a Panel's Minor Axis?

At the moment I am using

pnl = pd.Panel( ... )
for key, df in pnl.transpose(2,1,0).iteritems():
   print( key )

but it looks ugly and unpythonic.

Was it helpful?

Solution

In [27]: for key in pnl.minor_axis :
   ....:         print key
   ....:         print pnl.minor_xs (key)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top