Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

pandas count empty string values

import pandas as pd, numpy as np

df = pd.DataFrame({'currency':['USD','','EUR','']})

(df['currency'].values == '').sum()           # 2

len(df[df['currency'] == ''])                 # 2

df.loc[df['currency'] == ''].count().iloc[0]  # 2
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #pandas #count #empty #string #values
ADD COMMENT
Topic
Name
9+4 =