Skip to content

Commit bfabeeb

Browse files
TST: Wrote test for Float64 conversion pandas-dev#40729
1 parent 96b036c commit bfabeeb

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

pandas/tests/dtypes/test_dtypes.py

+11
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
date_range,
3838
)
3939
import pandas._testing as tm
40+
from pandas.core.arrays.floating import Float64Dtype
4041
from pandas.core.arrays.sparse import (
4142
SparseArray,
4243
SparseDtype,
@@ -1152,3 +1153,13 @@ def test_multi_column_dtype_assignment():
11521153

11531154
df["b"] = 0
11541155
tm.assert_frame_equal(df, expected)
1156+
1157+
1158+
def test_Float64_conversion():
1159+
# GH#40729
1160+
testseries = Series(["1", "2", "3", "4"], dtype="object")
1161+
result = testseries.astype(Float64Dtype())
1162+
1163+
expected = Series([1.0, 2.0, 3.0, 4.0], dtype=Float64Dtype())
1164+
1165+
tm.assert_series_equal(result, expected)

0 commit comments

Comments
 (0)