def convert_dict_to_darray(dict_with_tuples_key, myarray):
    idx_max_array = np.max(myarray, axis=0)
idx_max_dict = np.max(list(dict_with_tuples_key.keys()), axis=0)
lens = np.max([list(idx_max_array), list(idx_max_dict)], axis=0)
xlen, ylen = lens[0] + 1, lens[1] + 1
darray = dok_matrix((xlen, ylen))
for key, value in list(dict_with_tuples_key.items()):
    darray[key[0], key[1]] = value
return darray
2D-массив для представления огромного python dict, COOrdinate как решение для экономии памяти