New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ordered_merge improvements #1870

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

Comments

Projects
None yet
6 participants
@leonbaum

This comment has been minimized.

Show comment
Hide comment
@leonbaum

leonbaum Oct 24, 2012

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

leonbaum commented Oct 24, 2012

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

@yarivm

This comment has been minimized.

Show comment
Hide comment
@yarivm

yarivm Jan 24, 2013

+1 vote for "ordered left joins."

yarivm commented Jan 24, 2013

+1 vote for "ordered left joins."

@ngcrawford

This comment has been minimized.

Show comment
Hide comment
@ngcrawford

ngcrawford Feb 15, 2013

+1 vote for "ordered left joins.

ngcrawford commented Feb 15, 2013

+1 vote for "ordered left joins.

@chrisaycock

This comment has been minimized.

Show comment
Hide comment
@chrisaycock

chrisaycock Sep 4, 2014

Contributor

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

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).

@jreback

This comment has been minimized.

Show comment
Hide comment
@jreback

jreback Sep 4, 2014

Contributor

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

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.

@chrisaycock

This comment has been minimized.

Show comment
Hide comment
@chrisaycock

chrisaycock Sep 4, 2014

Contributor

@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.

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 milestones: 0.18.2, Someday Jun 3, 2016

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

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

ENH: add pd.asof_merge

closes #1870

@jreback 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