1

Hi I have the following Data frame (the actual is huge with 100 columns and 500K rows)

enter image description here

I want to create a new column called NewCol which will contain for each row, the value from the correct column (chosen by Col) Meaning :

enter image description here

Is there an elegant way to do this, without just iterating over the rows with a simple for loop ?

OopsUser
  • 4,642
  • 7
  • 46
  • 71
  • I updated the [question](https://stackoverflow.com/questions/69352472/lookup-values-by-corresponding-column-header-in-pandas-1-2-0-or-newer) with a simple [answer](https://stackoverflow.com/a/72515784/15239951) IMHO – Corralien Jun 06 '22 at 09:44

0 Answers0