Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

pandas fillna by rows

# for the whole dataframe
df = df.fillna(axis=1, method='backfill')
# only for some columns
df[['A', 'B', 'C']] = df[['A', 'B', 'C']].fillna(axis=1, method='backfill')
 
PREVIOUS NEXT
Tagged: #pandas #fillna #rows
ADD COMMENT
Topic
Name
3+4 =