将列值分为单独的行(Pivot)
我有一个看起来像这样的数据集:
App Downloads Permissions
A 123 56
B 89 12
我想修改df
看起来像这样:
App Title Value
A Downloads 123
A Permissions 56
B Downloads 89
B Permissions 12
我该如何实现?我已经研究了Pivot_table功能,但似乎与我试图实现的目标有些不同。另外,不确定我要创建的新列的名称(标题/值)
I have a dataset that looks like this:
App Downloads Permissions
A 123 56
B 89 12
I want to modify the df
to look like like this:
App Title Value
A Downloads 123
A Permissions 56
B Downloads 89
B Permissions 12
How can I achieve this? I have looked into the pivot_table functions but it seems a bit different than what I am trying to achieve. Also, not sure how to add the names (Title/Value) for the new columns I want to create
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用
融化
获得这些结果You could use
melt
to get these results