Skip to content

Add option to disable exact matches optional in join_asof #41786

Description

@0x26res

Describe the enhancement requested

I would like to do a join_asof that would exclude exact matches.

This is supported in pandas https://pandas.pydata.org/docs/reference/api/pandas.merge_asof.html

In the example below, I expect [1,2,2,3] instead of [1,2,3,4].

 left = pa.table({"left": [10, 20, 30, 40], "key": [1, 1, 1, 1]})
right = pa.table(
{
"right": [9, 12, 30, 41],
"key": [1, 1, 1, 1],
"value": [1, 2, 3, 4],
}
)
assert left.join_asof(
right, on="left", by="key", tolerance=-10, right_on="right", right_by="key"
) == pa.table(
{
"left": [10, 20, 30, 40],
"key": [1, 1, 1, 1],
"value_right": [1, 2, 3, 3], # Should be [1,2,2,3]
}
)

Component(s)

Python

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions