Below is my loop to loop through a bigger array (sortdata), pull out individual columns, and save those into a dictionary based on its iteration in the loop. My problem is that this loop is only looping through and saving just one column. It saves the variabledict[1] array and nothing else. The sortdata array contains four columns (the first two do not have pertinent data so I omitted them in the code). There should be a variabledict[0]. Any help would be greatly appreciated.
datavalues = floating number that pertains to total columns
sortdata = large array I am pulling data from
for k in range(int(datavalues - 2)):
datavalloop = sortdata[:][0:,k + 2]
variabledict = {}
variabledict[k] = datavalloop
variabledictto be an emptydictinside the loop, so it goes back to{}every time, and only the final iteration will leave anything stored in thedict.