Here, limit option of FILLNA will help: Look at the below commands:
#First Created a data frame
import pandas as pd
Above, you can see that data frame has missing values.
#Used ffill method to fill missing values
fillna with ffill method has fill all missing values with previous non missing value
#Used option limit to restrict the value to fill
After using limit=2 option, it has only filled second third observation of third column not the last one.
Hope this helps!