I have a data frame with many columns. I would like to fill the nan's with 0's for the last x number of columns. I used the following code but it doesn't seem to work.
df.iloc[:, -10:-1].fillna(value=0, inplace=True)
What am I doing wrong? when I specifically refer to a column by name:
df['column_a'].fillna(value=0, inplace=True)
it works, but I'd rather not do it one column at a time.