0

I am beginner in pandas. I have one query, Let's say i have one df which is input as

sno y   x   x    x
1   47 abs owi  pyt
2   57 uyh jig  ojt
3   84 urr isj  ieh

and the output should be like

sno  y   x
1   47 abs,owi,pyt
2   57 uyh,jig,ojt
3   84 urr,isj,ieh

Thanks for the solution in advanced

ash
  • 33
  • 5
  • if first column is the index you can do `df.agg(','.join,1)` – anky Mar 27 '20 at 16:50
  • 1
    Does this answer your question? [Python Pandas merge samed name columns in a dataframe](https://stackoverflow.com/questions/24390645/python-pandas-merge-samed-name-columns-in-a-dataframe) – akaur Mar 27 '20 at 16:50
  • i have tried that but that is not working for me – ash Mar 27 '20 at 17:06

0 Answers0