Skip to content

Commit aea7c45

Browse files
committed
BUG: work around another NumPy 1.6 concatenate bug with datetime64, close #1745
1 parent b956be0 commit aea7c45

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

RELEASE.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ pandas 0.8.2
3838

3939
**Bug fixes**
4040

41-
- Fix critical DatetimeIndex.union bug (#1730, #1719)
41+
- Fix critical DatetimeIndex.union bugs (#1730, #1719, #1745)
4242
- Fix MM-YYYY time series indexing case (#1672)
4343
- Fix case where Categorical group key was not being passed into index in
4444
GroupBy result (#1701)

pandas/core/index.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ def union(self, other):
538538

539539
if len(indexer) > 0:
540540
other_diff = ndtake(other.values, indexer)
541-
result = np.concatenate((self.values, other_diff))
541+
result = com._concat_compat((self.values, other_diff))
542542
try:
543543
result.sort()
544544
except Exception:

pandas/tseries/tests/test_timeseries.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1169,6 +1169,16 @@ def test_union_bug_1730(self):
11691169
exp = DatetimeIndex(sorted(set(list(rng_a)) | set(list(rng_b))))
11701170
self.assert_(result.equals(exp))
11711171

1172+
def test_union_bug_1745(self):
1173+
left = DatetimeIndex(['2012-05-11 15:19:49.695000'])
1174+
right = DatetimeIndex(['2012-05-29 13:04:21.322000',
1175+
'2012-05-11 15:27:24.873000',
1176+
'2012-05-11 15:31:05.350000'])
1177+
1178+
result = left.union(right)
1179+
exp = DatetimeIndex(sorted(set(list(left)) | set(list(right))))
1180+
self.assert_(result.equals(exp))
1181+
11721182
# def test_add_timedelta64(self):
11731183
# rng = date_range('1/1/2000', periods=5)
11741184
# delta = rng.values[3] - rng.values[1]

0 commit comments

Comments
 (0)