1

I have a dataframe with 124 columns, one of these columns is named '1ST', thus when I try to call it I get this error:

[IN]: print(data.1ST)
[OUT]:   File "<ipython-input-163-1807245f448a>", line 1
           print(data.1ST)
                ^
     SyntaxError: invalid syntax

Is there a way to call this series? I've already tried with something like this:

[IN]: print(eval('data.' + str(1ST)))

but that still doesn't work

Jerry Fanelli
  • 81
  • 1
  • 2
  • 6

1 Answers1

1

use index notation

data['1ST']
yoyoyoyo123
  • 2,362
  • 2
  • 22
  • 36