Stack Overflow Asked by TLanni on November 27, 2021
I have following dataframe containing list in the column
item list
['ABC','PQR']
['DEF']
[]
I want to add another column called "item".which contains the corresponding string to that list
item list item
['ABC','PQR'] ABC,PQR
['DEF'] DEF
[]
I have tried the following
df["item"]=df["item list"].apply(lambda x:",".join(x))
but it’s giving me wrong answer like th following
item list item
['ABC','PQR'] A,B,C,P,Q,R
['DEF'] D,E,F
[]
I need to get the follwoing answer.How can I achieve it?
item list item
['ABC','PQR'] ABC,PQR
['DEF'] DEF
[]
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP