Sql While Loop Through Array Python Initialize Matrix Of Zeros