![](/img/trans.png)
[英]Create a dictionary from dataframe column which has more than one value in its cell
[英]create multiple rows if a column has more than one value in a dataframe
您可以使用 pandas.explode() function:
>>> df.explode('events').reset_index(drop=True)
cust events
0 fnwp abhi
1 fnwp ashu
2 utp abhi
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.