I am trying to create a list which should contain numeric values which I am trying to extract from a dataframe. The following is my code:
list_values = []
j = 0
for i in country_list:
list_values[j] = df6['positioning'][i].to_numpy()
j = j + 1
print(list_values)
When I am trying to just print the values directly without storing them in the list I can do that, but somehow I am not able to store them in the list or a 2d numpy array. What is going wrong?
The following is the error:
IndexError: list assignment index out of range