python - Pandas 面板 : How To Iterate Over the Minor Axis?

标签 python python-3.x pandas

迭代面板短轴中所有项目(数据框)的首选方法是什么?

目前我正在使用

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

但它看起来丑陋且不符合 Python 标准。

最佳答案

In [27]: for key in pnl.minor_axis :
   ....:         print key
   ....:         print pnl.minor_xs (key)

关于python - Pandas 面板 : How To Iterate Over the Minor Axis?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23557592/

相关文章:

python - ctypes:提取 C 库返回的结构成员

python - NetworkX - 从数据帧设置节点属性

python - 在 python 中混合使用 switch 和 rotate 对数字进行排序

python - 第一列数据框中每两个元素的共同元素

Python pandas 显示重复值

python - 使用 TF 数据集和 Eager 创建有状态计数器

python - 获取本地时区的 Olson TZ 名称?

python - 与 4 之和相切的组合的组合

python - 如何删除 Tkinter OptionMenu 小部件的边框

javascript - 如何在 typescript/js 中处理 'this' ?需要将Python代码转换为Typescript