ffill missing data based on the sort order of another column I have a column with missing data that I need to imput.  Column is called 'Bandwidth'.  There is a relationship between the Bandwidth column, and another column called 'Age'.  As Age increases, so does Bandwidth.
I want to ffill Bandwidth, but I have to do it based on the value in Age.  I have over 10k records, so there is too much data to create a dictionary. I have scoured the internet, and so far am not able to find a solution.
In the simplest form of what I want to do is this:
df.sort_values(['Age'])
df['Bandwidth'].fillna(method='ffill',inplace=True)
It did fill the bandwidth, based on the'sort' of bandwidth,  but not based on the Age sort.
The yellow ones were filled with the data from the green ones, but as you can see, the 'Age' is random.

But this is what I am needing it to do... (sort by age, then fill bandwidth from the above value.)
Since you mentioned that there is a linear relationship between Age and Bandwidth, you could train a simple linear model i.e linear regression on your dataset to estimate the bandwidth based on Age. Once you have figured out the relationship you can use it to impute the missing bandwidths.