File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -448,7 +448,7 @@ def to_object_array_tuples(list rows):
448
448
result = np.empty((n, k), dtype = object )
449
449
450
450
for i from 0 <= i < n:
451
- row = rows[i]
451
+ row = tuple ( rows[i]) # upcast any subclasses to tuple
452
452
453
453
for j from 0 <= j < len (row):
454
454
result[i, j] = row[j]
Original file line number Diff line number Diff line change @@ -275,6 +275,17 @@ def test_unicode(self):
275
275
def test_datetime (self ):
276
276
pass
277
277
278
+ def test_to_object_array_tuples (self ):
279
+ r = (5 ,6 )
280
+ values = [r ]
281
+ result = lib .to_object_array_tuples (values )
282
+
283
+ # make sure record array works
284
+ import collections as col
285
+ record = col .namedtuple ('record' , 'x y' )
286
+ r = record (5 ,6 )
287
+ values = [r ]
288
+ result = lib .to_object_array_tuples (values )
278
289
279
290
class TestMoments (unittest .TestCase ):
280
291
pass
You can’t perform that action at this time.
0 commit comments