If I have a dataframe with multiple columns [\'x\', \'y\', \'z\'], how do I forward fill only one column \'x\'? Or a group of columns [\'x\',
[\'x\', \'y\', \'z\']
\'x\'
[\'x\',
I used below code, Here for X and Y method can be different also instead of ffill().
df1 = df.fillna({ 'X' : df['X'].ffill(), 'Y' : df['Y'].ffill(), })