We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents f15b176 + 4288d0f commit 1bd9cc7Copy full SHA for 1bd9cc7
pandas/tests/test_frame.py
@@ -3387,6 +3387,22 @@ def test_from_records_misc_brokenness(self):
3387
exp = DataFrame(data, index=['a', 'b', 'c'])
3388
assert_frame_equal(result, exp)
3389
3390
+
3391
+ # GH 2623
3392
+ rows = []
3393
+ rows.append([datetime(2010, 1, 1), 1])
3394
+ rows.append([datetime(2010, 1, 2), 'hi']) # test col upconverts to obj
3395
+ df2_obj = DataFrame.from_records(rows, columns=['date', 'test'])
3396
+ results = df2_obj.get_dtype_counts()
3397
+ expected = Series({ 'datetime64[ns]' : 1, 'object' : 1 })
3398
3399
3400
3401
+ rows.append([datetime(2010, 1, 2), 1])
3402
3403
3404
+ expected = Series({ 'datetime64[ns]' : 1, 'int64' : 1 })
3405
3406
def test_to_records_floats(self):
3407
df = DataFrame(np.random.rand(10, 10))
3408
df.to_records()
0 commit comments