I want to pull out a set of fields for objects in a Django queryset and convert them into a matrix with the fields as columns for some computation. I've gotten to the point of :
qs = models.Devices.objects.all()
params = qs.values('b1', 'b2', 'b3', 'b4', 'b5', 'b6', 'b7', 'b8')
which returns a list of dictionaries ordered by object.
I want to know if there's a good way to convert these into rows of a numpy matrix and also if there is a way to keep an index of where these values are held in the db?
I want to do some calculations (sometimes different ones depending on the parameter type) and then eventually use the resultant vectors to populate/overwrite an existing column in the db such that the ordering is the same.