count number of zeros in pandas dataframe code example Example: df count zeros df.astype(bool).sum(axis=0)