Can we call ```coo_arrays_to_sparse``` here, now that we have rows, cols, values, n_rows, and n_cols?  This would reduce code duplication.