Skip to content

Commit 079b5c9

Browse files
TST: Moved test pandas-dev#40729
1 parent bfabeeb commit 079b5c9

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

pandas/tests/arrays/floating/test_astype.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,3 +116,13 @@ def test_astype_object(dtype):
116116
# check exact element types
117117
assert isinstance(result[0], float)
118118
assert result[1] is pd.NA
119+
120+
121+
def test_Float64_conversion():
122+
# GH#40729
123+
testseries = pd.Series(["1", "2", "3", "4"], dtype="object")
124+
result = testseries.astype(pd.Float64Dtype())
125+
126+
expected = pd.Series([1.0, 2.0, 3.0, 4.0], dtype=pd.Float64Dtype())
127+
128+
tm.assert_series_equal(result, expected)

pandas/tests/dtypes/test_dtypes.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
date_range,
3838
)
3939
import pandas._testing as tm
40-
from pandas.core.arrays.floating import Float64Dtype
4140
from pandas.core.arrays.sparse import (
4241
SparseArray,
4342
SparseDtype,
@@ -1153,13 +1152,3 @@ def test_multi_column_dtype_assignment():
11531152

11541153
df["b"] = 0
11551154
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)