Convert between csr and lil before mapping