Home > Back-end >  'RangeIndex' object is not callable
'RangeIndex' object is not callable

Time:08-19

Index cannot be found when repetitive variable creation is applied.

code

index_100 = globals()['df_n{}'.format(i)]['value'].index(100)

error

'RangeIndex' object is not callable

CodePudding user response:

If you want to find 101th element in index, you need indexing with []

index_100 = globals()['df_n{}'.format(i)]['value'].index[100]
  • Related