I am trying to find the count of distinct values in each column using Pandas. This is what I did.
import pandas as pd import numpy as np # Generate data. NR
I found:
df.agg(['nunique']).T
much faster