A 1: 200 Seitenverhältnis ziemlich schlecht ist und, da man in den Speicher Probleme laufen könnte, sollten Sie wahrscheinlich brechen in mehrere Nx1k Stücke.
aber sagen, dass hier ist meine Lösung (durch Ihr Beispiel Bild inspiriert):
from mpl_toolkits.axes_grid1 import AxesGrid
# generate random matrix
xDim = 2000
yDim = 4000
# number of nans
nNans = xDim*yDim*.1
rands = np.random.rand(yDim, xDim)
# create a skewed distribution for the nans
x = np.clip(np.random.gamma(2, yDim*.125, size=nNans).astype(np.int),0 ,yDim-1)
y = np.random.randint(0,xDim,size=nNans)
rands[x,y] = np.nan
# find the nans:
isNan = np.isnan(rands)
fig = plt.figure()
# make axesgrid so we can put a histogram-like plot next to the data
grid = AxesGrid(fig, 111, nrows_ncols=(1, 2), axes_pad=0.05)
# plot the data using binary colormap
grid[0].imshow(isNan, cmap=cm.binary)
# plot the histogram
grid[1].plot(np.sum(isNan,axis=1), range(isNan.shape[0]))
# set ticks and limits, so the figure looks nice
grid[0].set_xticks([0,250,500,750,1000,1250,1500,1750])
grid[1].set_xticks([0,250,500,750])
grid[1].set_xlim([0,750])
grid.axes_llc.set_ylim([0, yDim])
plt.show()
Hier ist, wie es aussieht:
Ich denke, [missingno] (https: //github.com/ResidentMario/missingno) könnte einen Blick wert sein. Nicht sicher, ob es tun kann, was Sie brauchen, aber ... – swenzel