I have a large linear system $AX = B$ given by sparse matrices with $A,X,B$ being large matrices of size $n\times n, n\times m, n\times m$ respectively. Both $A$ and $B$ are sparse matrices and $n\gg m$, and $X$ is known to be dense. There are many methods to solve these sorts of systems, but I am interested only in a few (say $p\simeq m \ll n$) rows of $X$.
Since $X$ is dense, it would be useful to have an algorithm that only calculates the relevant rows without storing all $n$ rows in memory, which becomes the limiting factor of the computation. I am particularly interested in Python implementations, if they exist.