csr_mat = scipy.sparse.rand(1000, 1000, density=0.001, format='csr')
petsc_mat = PETSc.Mat().createAIJ(size=csr_mat.shape, csr=(csr_mat.indptr,
    csr_mat.indices, csr_mat.data))
scipy sparse matrices as an input for petsc4py