I have an huge csv and i have to create a numpy array for the same argument in a certain column (the type ara about 10) but i have a problem with my list: it's too big and python goes down:
def mem():
file = pd.read_csv(file_csv)
x = []
y = []
path_prec = 0
for index, row in file.iterrows():
if path_prec == 0:
path_prec = row[0]
if path_prec!= row[0]:
X = np.stack(x, axis=0)
Y = np.stack(y, axis=0)
#save X and Y
x = []
y = []
path_prec = row[0]
#do some stuff and create a list
top = int(row[2])
bottom = int(row[3])
left = int(row[4])
right = int(row[5])
patch = image[top:bottom, left:right]
patch_gt = gt[top:bottom, left:right]
x.append(patch)
y.append(patch_gt)
haw can i manage so huge data? with generator? how?
edit: this huge csv contains information to find data in fyle system