scipy.sparse.dok_matrix. set_shape# dok_matrix.set_shape(shape)[источник]# Установить форму матрицы на месте