Skip to content

TST: Wrote test for Float64 conversion #40729 #48205

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 26, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions pandas/tests/dtypes/test_dtypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
date_range,
)
import pandas._testing as tm
from pandas.core.arrays.floating import Float64Dtype
from pandas.core.arrays.sparse import (
SparseArray,
SparseDtype,
Expand Down Expand Up @@ -1152,3 +1153,13 @@ def test_multi_column_dtype_assignment():

df["b"] = 0
tm.assert_frame_equal(df, expected)


def test_Float64_conversion():
# GH#40729
testseries = Series(["1", "2", "3", "4"], dtype="object")
result = testseries.astype(Float64Dtype())

expected = Series([1.0, 2.0, 3.0, 4.0], dtype=Float64Dtype())

tm.assert_series_equal(result, expected)