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
df.apply(lambda x: len(x.unique()))