python - How to combine multiple rows into a single row with pandas - Stack Overflow

PHOTO EMBED

Wed Aug 10 2022 04:27:08 GMT+0000 (Coordinated Universal Time)

Saved by [deleted user] #python

print df.groupby('value')['tempx'].apply(' '.join).reset_index()
   value                                              tempx
0    1.5  picture1 picture555 picture255 picture365 pict...
content_copyCOPY

https://stackoverflow.com/questions/36392735/how-to-combine-multiple-rows-into-a-single-row-with-pandas