Skip to content

Commit dae25de

Browse files
committed
Merge pull request #6330 from jreback/align
BUG: Regression in join of non_unique_indexes (GH6329)
2 parents 87b4308 + e1dec2f commit dae25de

File tree

3 files changed

+24
-4
lines changed

3 files changed

+24
-4
lines changed

doc/source/release.rst

+1
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ Bug Fixes
9090
- ``HDFStore.remove`` now handles start and stop (:issue:`6177`)
9191
- ``HDFStore.select_as_multiple`` handles start and stop the same way as ``select`` (:issue:`6177`)
9292
- ``HDFStore.select_as_coordinates`` and ``select_column`` works where clauses that result in filters (:issue:`6177`)
93+
- Regression in join of non_unique_indexes (:issue:`6329`)
9394

9495
pandas 0.13.1
9596
-------------

pandas/core/ops.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -476,16 +476,15 @@ def wrapper(left, right, name=name):
476476
wrap_results = time_converted.wrap_results
477477

478478
if isinstance(rvalues, pd.Series):
479-
join_idx, lidx, ridx = left.index.join(rvalues.index, how='outer',
480-
return_indexers=True)
481-
rindex = rvalues.index
479+
rindex = getattr(rvalues,'index',rvalues)
482480
name = _maybe_match_name(left, rvalues)
483481
lvalues = getattr(lvalues, 'values', lvalues)
484482
rvalues = getattr(rvalues, 'values', rvalues)
485483
if left.index.equals(rindex):
486484
index = left.index
487485
else:
488-
index = join_idx
486+
index, lidx, ridx = left.index.join(rindex, how='outer',
487+
return_indexers=True)
489488

490489
if lidx is not None:
491490
lvalues = com.take_1d(lvalues, lidx)

vb_suite/join_merge.py

+20
Original file line numberDiff line numberDiff line change
@@ -202,3 +202,23 @@ def sample(values, k):
202202
"""
203203

204204
stmt = "ordered_merge(left, right, on='key', left_by='group')"
205+
206+
#----------------------------------------------------------------------
207+
# outer join of non-unique
208+
# GH 6329
209+
210+
setup = common_setup + """
211+
date_index = pd.date_range('01-Jan-2013', '23-Jan-2013', freq='T')
212+
daily_dates = date_index.to_period('D').to_timestamp('S','S')
213+
fracofday = date_index.view(np.ndarray) - daily_dates.view(np.ndarray)
214+
fracofday = fracofday.astype('timedelta64[ns]').astype(np.float64)/864e11
215+
fracofday = pd.TimeSeries(fracofday, daily_dates)
216+
index = pd.date_range(date_index.min().to_period('A').to_timestamp('D','S'),
217+
date_index.max().to_period('A').to_timestamp('D','E'),
218+
freq='D')
219+
temp = pd.TimeSeries(1.0, index)
220+
"""
221+
222+
join_non_unique_equal = Benchmark('fracofday * temp[fracofday.index]', setup,
223+
start_date=datetime(2013 1, 1))
224+

0 commit comments

Comments
 (0)