Closed
Description
The docs say fill_method
is the "Interpolation method for data", but I just tried pd.merge_ordered(..., fill_method='linear')
and it didn't interpolate.
Looking closer at the docs, fill_method
can only be either 'ffill'
or None
, but apparently that's not actually checked; for example, fill_method='carrot'
also works.
fill_method : {'ffill', None}, default None
Interpolation method for data.
Looks like this code is responsible:
pandas/pandas/core/reshape/merge.py
Lines 1859 to 1868 in a167f13
It should probably be changed to something like:
if self.fill_method == "ffill":
if left_indexer is None:
...
elif self.fill_method is None:
left_join_indexer = left_indexer
right_join_indexer = right_indexer
else:
raise ValueError(f"fill_method must be one of ['ffill']. Got '{self.fill_method}' instead.")
(ValueError text based on equivalent df.interpolate
error)