Pandas Panel: how to move along the secondary axis?

What is the preferred way to iterate over all the elements (which are dataframes) in the minor axis group?

I'm currently using

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

but he looks ugly and troubled.

+4
source share
1 answer
In [27]: for key in pnl.minor_axis :
   ....:         print key
   ....:         print pnl.minor_xs (key)
+4
source

Source: https://habr.com/ru/post/1539865/


All Articles