I'd like to analyze a dataset (data) with 300,000 dimensional elements, but I can't get through if I want to draw the code for storing each batch of elements in an instance with a for statement.I want to store 1200 elements of the i-th batch in new[i], but I don't know.I did the following.
for i in range (250):
new = [ ]
new[i]=data[4000*i+1:300000*(i+1)/250]
Currently, list assignment index out of range
error occurs because new[i]
has not been initialized.There are many problems, but why don't you start with the following code?
new=[]
for i in range (250):
new.append (data [1200*i:1200*(i+1)])
© 2025 OneMinuteCode. All rights reserved.