【发布时间】:2021-11-16 22:22:52
【问题描述】:
我有一个数据集,其中 n 列带有标识数据,x 列带有属性。 我希望每一行都有标识符并且只有一个属性。如果一个对象有多个属性,它将出现在多行中。我可以用什么?谢谢
在 df 中
artist_name, country, album,song title...., extra artist 1, extra artist 2, extra artist 3,...extra artist 100
输出df
artist_name, country, album,song title...., extra artist 1
artist_name, country, album,song title...., extra artist 2
artist_name, country, album,song title...., extra artist 3
...
artist_name, country, album,song title...., extra artist 100
【问题讨论】:
-
欢迎来到 Stack Overflow。您能否添加一个最小的可重现示例? stackoverflow.com/help/minimal-reproducible-example
-
请提供足够的代码,以便其他人更好地理解或重现问题。
标签: python pandas dataframe reshape