Let's assume a pivot table $P$ of shape $m\times n$ where $p_{i,j}$ is number of coincidences of $i$ and $j$.
I would like to have to permute the columns and rows to see some blocks of similarity.
Some artificial data generated in the following code:
import matplotlib
import numpy as np
import matplotlib.pyplot as plt
m=50
n=100
P = np.zeros([m,n])
for i in range(10):
P[i*5:((i+1)*5),i*10:((i+1)*10)]=1
permute_rows = np.random.permutation(m).tolist()
permute_columns = np.random.permutation(n).tolist()
P_to_solve = P[np.ix_(permute_rows, permute_columns)]
fig,[ax1,ax2] = plt.subplots(2)
ax1.imshow(P_to_solve)
ax1.set_ylabel('What I have')
ax2.imshow(P)
ax2.set_ylabel('What I want')