Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
4 views
in Python by (120 points)

This is the portion of the code where i am getting this error. Can you suggest a solution for this problem

f_TP = open("./result_analyze/BGRU/TP_filenames.txt","ab+")

    for i in range(len(str(result[1]))):

       TP_index = result[i]

       f_TP.write(str(filenames[TP_index])+'\n')

The error is :

Traceback (most recent call last):

  File "bgru.py", line 240, in <module>

    main(traindataSetPath, testdataSetPath, realtestdataSetPath, weightPath, resultPath, batchSize, maxLen, vectorDim, layers, dropout)

  File "bgru.py", line 154, in main

    f_TP.write((filenames[TP_index])+'\n')

TypeError: list indices must be integers, not numpy.float64

Please log in to answer this question.

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...