Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Pandas drop empty rows

import pandas as pd


# Create a Dataframe from a CSV
df = pd.read_csv('example.csv')

# Drop rows with any empty cells
df.dropna(
    axis=0,
    how='any',
    thresh=None,
    subset=None,
    inplace=True
)
Source by hackersandslackers.com #
 
PREVIOUS NEXT
Tagged: #Pandas #drop #empty #rows
ADD COMMENT
Topic
Name
5+4 =