Skip to content

merge_asof(..., left_on='a', right_index=True) #6183

Closed

Description

@noreentry

Hello!

There is an issue with dask.dataframe.merge_asof() when merging column in the left df with index in the right:

nparts = 1
dd.merge_asof(dd.from_pandas(pd.DataFrame(index=[10,20,30], data={'a':[5, 15,25]}), npartitions=nparts),
              dd.from_pandas(pd.DataFrame(index=[10,20,30], data={'b':[10,20,30]}), npartitions=nparts),
              left_on='a', right_index=True).compute()
  a b
0 5 NaN
1 15 10.0
2 25 20.0
3 5 NaN
4 15 10.0
5 25 20.0

Splitting data into 3 partitions i get:

nparts = 3
dd.merge_asof(dd.from_pandas(pd.DataFrame(index=[10,20,30], data={'a':[5, 15,25]}), npartitions=nparts),
              dd.from_pandas(pd.DataFrame(index=[10,20,30], data={'b':[10,20,30]}), npartitions=nparts),
              left_on='a', right_index=True).compute()
  a b
0 5 NaN
1 5 NaN
0 15 10.0
1 25 10.0
2 15 10.0
3 25 20.0

Expected result is:

pd.merge_asof(pd.DataFrame(index=[10,20,30], data={'a':[5, 15,25]}),
              pd.DataFrame(index=[10,20,30], data={'b':[10,20,30]}),
              left_on='a', right_index=True)
  a b
10 5 NaN
20 15 10.0
30 25 20.0

Activity

  1. jcrist commented on May 7, 2020

    @jcrist
    Member

    Thanks for the excellent reproducible issue @noreentry. This indeed is a bug. Would you be interested in looking deeper into this issue?

  2. jcrist commented on May 18, 2020

    @jcrist
    Member

    Fixed by #6192.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions