File tree 1 file changed +31
-0
lines changed
1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -2436,3 +2436,34 @@ def test_dt64arr_addsub_object_dtype_2d():
2436
2436
2437
2437
assert result2 .shape == (4 , 1 )
2438
2438
assert all (td ._value == 0 for td in result2 .ravel ())
2439
+
2440
+
2441
+ def test_concat_float_datetime64 ():
2442
+ # GH#32934
2443
+ df_time = pd .DataFrame ({"A" : pd .array (["2000" ], dtype = "datetime64[ns]" )})
2444
+ df_float = pd .DataFrame ({"A" : pd .array ([1.0 ], dtype = "float64" )})
2445
+
2446
+ tm .assert_equal (
2447
+ pd .concat ([df_time , df_float ]),
2448
+ pd .DataFrame (
2449
+ {
2450
+ "A" : [
2451
+ pd .array (["2000" ], dtype = "datetime64[ns]" )[0 ],
2452
+ pd .array ([1.0 ], dtype = "float64" )[0 ],
2453
+ ]
2454
+ },
2455
+ index = [0 , 0 ],
2456
+ ),
2457
+ )
2458
+ tm .assert_equal (
2459
+ pd .concat ([df_time .iloc [:0 ], df_float .iloc [:0 ]]),
2460
+ pd .DataFrame ({"A" : pd .array ([], dtype = "object" )}),
2461
+ )
2462
+ tm .assert_equal (
2463
+ pd .concat ([df_time .iloc [:0 ], df_float ]),
2464
+ pd .DataFrame ({"A" : pd .array ([1.0 ], dtype = "object" )}),
2465
+ )
2466
+ tm .assert_equal (
2467
+ pd .concat ([df_time , df_float .iloc [:0 ]]),
2468
+ pd .DataFrame ({"A" : pd .array (["2000" ], dtype = "datetime64[ns]" )}),
2469
+ )
You can’t perform that action at this time.
0 commit comments