pandas count empty string values

Solutions on MaxInterview for pandas count empty string values by the best coders in the world

showing results for - "pandas count empty string values"
Deandre
24 Jul 2020
1import pandas as pd, numpy as np
2
3df = pd.DataFrame({'currency':['USD','','EUR','']})
4
5(df['currency'].values == '').sum()           # 2
6
7len(df[df['currency'] == ''])                 # 2
8
9df.loc[df['currency'] == ''].count().iloc[0]  # 2
10