I have a dataframe in Python and I want to move the data in the dataframe so that NaN
values are removed. For example I want turn a dataframe that looks like this:
to this:
Note that this is different from using the ffill()
function since this function copies/repeats the data, while on the other hand I want to actually move/shift the data over to the left as much as I can. Is there a function which can be used to do this?