- Remove all entries with empty strings OR empty cells
for col in rawData.columns: # Iterate over all cols
#print(f'col: {col}')
# Replace empty strings (if any), with NaN
df[col].replace('', np.nan, inplace=True)
# Remove all rows with any entry = NaN
df.dropna(subset=[col], inplace=True)
- List number of elements in each column
print(rawData.count(axis=0))