I want to batch the data set...

Asked 2 years ago, Updated 2 years ago, 63 views

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]

python python3 deep-learning ipython

2022-09-30 10:19

1 Answers

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)])


2022-09-30 10:19

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.