请问这种使用 DataFrame 该如何实现?


请问这种使用 DataFrame 该如何实现?

1 lookStupiToForce Dec 5, 2022 two methods: 1. multi level index intuitive but not recommended https://pandas.pydata.org/docs/user_guide/advanced.html 2. duplicate values in first two columns to match third columns row count |
2 Alias4ck Dec 6, 2022  不知道是不是你想要的 其实楼上也给出方案了 |
3 wliansheng OP |
4 craiiz Dec 8, 2022 这个比较像透视表吧?直接 pd.pivot_table(df, index=["用户", "联系方式等信息"]) 应该就行了 |
5 wliansheng OP @craiiz 感谢帮助,我去试试 |