Python- Indexerror: list index out of range while defining a function

27 Views Asked by At

I am getting the following error when I'm running a python script which is used for pre processing csv file. The error and the code snippet is shown below. In the function get_mech_update(), the arguments have the following types:

  • slat_tr - list
  • flap_tr - list
  • template- csv file with certain rows and columns

The error is on the line with the code :

  • template=template.append([template]*(len(slat_tr)+len(flap_tr))*2,ignore_index=True)

pics 1 and 2 combined is the overall code of function get_mech_update()

Error screenshot

1)The code snippet from the function def

2)Contd. code snippet from the function def

In the function call the three arguments have following types and sizes:

slat_tr -> null list->[]
flap_tr -> null list->[]
template-> pandas.core.frame.DataFrame-> 642 rows and 15 columns
0

There are 0 best solutions below