在熊猫中使用枢轴表时,如何显示所有值?
df_agg = pd.pivot_table(df, values= 'total_revenue', index= 'order_year',aggfunc= 'sum')
运行上述代码时,这就是我得到的。我很想获得总收入列的整个数字。
order_year | total_revenue |
---|---|
2010 | 4.95994e+08 |
2011 | 5.23411e+08 |
df_agg = pd.pivot_table(df, values= 'total_revenue', index= 'order_year',aggfunc= 'sum')
When I run the above code, this is what I get. I would love to get the entire figures for the total revenue column.
order_year | total_revenue |
---|---|
2010 | 4.95994e+08 |
2011 | 5.23411e+08 |
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以添加pandas set_option来更改查看数字的方式。
代码
输出
you can add pandas set_option to change the way you view the numbers.
Code
Output