Skip to content

BUG: Regression in join of non_unique_indexes (GH6329) #6330

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

Merged
merged 1 commit into from
Feb 12, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/source/release.rst
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ Bug Fixes
- ``HDFStore.remove`` now handles start and stop (:issue:`6177`)
- ``HDFStore.select_as_multiple`` handles start and stop the same way as ``select`` (:issue:`6177`)
- ``HDFStore.select_as_coordinates`` and ``select_column`` works where clauses that result in filters (:issue:`6177`)
- Regression in join of non_unique_indexes (:issue:`6329`)

pandas 0.13.1
-------------
Expand Down
7 changes: 3 additions & 4 deletions pandas/core/ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -476,16 +476,15 @@ def wrapper(left, right, name=name):
wrap_results = time_converted.wrap_results

if isinstance(rvalues, pd.Series):
join_idx, lidx, ridx = left.index.join(rvalues.index, how='outer',
return_indexers=True)
rindex = rvalues.index
rindex = getattr(rvalues,'index',rvalues)
name = _maybe_match_name(left, rvalues)
lvalues = getattr(lvalues, 'values', lvalues)
rvalues = getattr(rvalues, 'values', rvalues)
if left.index.equals(rindex):
index = left.index
else:
index = join_idx
index, lidx, ridx = left.index.join(rindex, how='outer',
return_indexers=True)

if lidx is not None:
lvalues = com.take_1d(lvalues, lidx)
Expand Down
20 changes: 20 additions & 0 deletions vb_suite/join_merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,3 +202,23 @@ def sample(values, k):
"""

stmt = "ordered_merge(left, right, on='key', left_by='group')"

#----------------------------------------------------------------------
# outer join of non-unique
# GH 6329

setup = common_setup + """
date_index = pd.date_range('01-Jan-2013', '23-Jan-2013', freq='T')
daily_dates = date_index.to_period('D').to_timestamp('S','S')
fracofday = date_index.view(np.ndarray) - daily_dates.view(np.ndarray)
fracofday = fracofday.astype('timedelta64[ns]').astype(np.float64)/864e11
fracofday = pd.TimeSeries(fracofday, daily_dates)
index = pd.date_range(date_index.min().to_period('A').to_timestamp('D','S'),
date_index.max().to_period('A').to_timestamp('D','E'),
freq='D')
temp = pd.TimeSeries(1.0, index)
"""

join_non_unique_equal = Benchmark('fracofday * temp[fracofday.index]', setup,
start_date=datetime(2013 1, 1))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jreback missing a comma here between the 2013 and the 1.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whoopsie. can u fix in your interpolate branch?