ordered_merge improvements #1870

Closed
wesm opened this Issue Sep 9, 2012 · 6 comments

Comments

Projects
None yet
6 participants

It would be great to be able to perform ordered left joins using a time-series index as well.

yarivm commented Jan 24, 2013

+1 vote for "ordered left joins."

+1 vote for "ordered left joins.

Contributor

chrisaycock commented Sep 4, 2014

Any thoughts on this? A kdb-style asof-join is very useful in time-series analysis. The rows of the right-hand table would just be picked via a DataFrame.asof (see #2941).

Contributor

jreback commented Sep 4, 2014

http://pandas.pydata.org/pandas-docs/stable/merging.html?highlight=ordered_merge#merging-ordered-data

(unless something else was meant here). This has been in for a while.

Contributor

chrisaycock commented Sep 4, 2014

@jreback Unlike the pd.ordered_merge(), the kdb aj() only keeps the rows from the left-hand table.

http://code.kx.com/wiki/Reference/aj

I.e., as with a regular left-join, the table doesn't get more rows; it just appends columns from the right-hand table.

Actually, it's very similar to a left-join, but instead of searching for equal keys, it searches for the greatest key from the right-hand table that is less-than-or-equal-to the key from the left-hand table. This is exactly what the asof function does in pandas, so we're part of the way there already.

@jreback jreback modified the milestone: 0.18.2, Someday Jun 3, 2016

@jreback jreback added a commit to jreback/pandas that referenced this issue Jun 15, 2016

@jreback jreback TST: reorg tests/series/test_timeseries -> test_asof
ENH: add DataFrame.asof

ENH: add pd.asof_merge

closes #1870
4592fa2

jreback closed this in 6d8c04c Jun 17, 2016

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