Sql While Loop Through Array Python Initialize Map