0

I tried to read the post you gave me, but there are like hundreds of things. I tried some and it didn't work. I think its because my column names are numbers.

my df is like this:

     1   2   3  x
1  1.2 3.2 4.4  1
2  5.4 2.2 1.4  3
3  5.6 3.4 2.3  1

I want to create a new column (y) with the value of the reference column name for every rows. my expected result

     1   2   3  x    y
1  1.2 3.2 4.4  1  1.2
2  5.4 2.2 1.4  3  1.4
3  5.6 3.4 2.3  1  5.6
One boy
  • 216
  • 1
  • 7

0 Answers0