Input data
- mtx: “<COOrdinate sparse matrix of dtype ‘int64’ with 357558594 stored elements and shape (30562, 96629557)>”
- mtx.todense()[0:2,0:8] = matrix([[4050, 24, 21, 3, 0, 3, 2, 1],
[1437, 17, 17, 3, 0, 3, 2, 1]])
- mtx.todense()[0:2,0:8] = matrix([[4050, 24, 21, 3, 0, 3, 2, 1],
- cspdata2d: numpy.ndarray
- cspdata2d.shape = (96629557, 2)
- cspdata2d[0:8,:] = array([[43426, 1414],
[ 5496, 20015],
[23193, 19957],
[ 2252, 28571],
[10910, 22382],
[ 1385, 19958],
[ 5508, 22828],
[25183, 22533]], dtype=int32)
Output
- outimg: np.zeros(shape=cspdata2d.max(axis=0), dtype=np.int16)
- outimg.shape = (51968, 40141)
I want to plot values of mtx.todense()[1:2,:]
with x,y = cspdata2d[index]
to outimg
, where index
is from the 2nd dimensions of mtx.
It is like scanpy.pl.spatial
, but I want to plot to pixels. And scanpy is slow on huge data set.