I have this kind of df :
values
str1
str1
nan
nan
str1
nan
nan
str2
nan
nan
str2
values are str. I want to fillna where rows are surrounded by the same value and get :
values
str1
str1
str1
str1
str1
nan
nan
str2
str2
str2
str2
Is there an option in the fillna function that can do that ?
EDIT :
Is there also an option to set a limit of number of rows between two str_i to fill ?