MCPcopy Create free account
hub / github.com/dask/dask / test_to_numeric

Function test_to_numeric

dask/dataframe/dask_expr/tests/test_collection.py:876–891  ·  view source on GitHub ↗
(pdf, df)

Source from the content-addressed store, hash-verified

874
875@pytest.mark.filterwarnings("ignore::UserWarning")
876def test_to_numeric(pdf, df):
877 import dask.array as da
878
879 pdf.x = pdf.x.astype("str")
880 expected = pd.to_numeric(pdf.x)
881 df.x = df.x.astype("str")
882 result = to_numeric(df.x)
883 assert_eq(result, expected)
884
885 result = to_numeric("1.0").compute()
886 assert result == 1.0
887
888 arr = df.x.to_dask_array()
889 expected = pd.to_numeric(pdf.x.to_numpy())
890 result = to_numeric(arr)
891 da.assert_eq(result, expected)
892
893
894def test_to_timedelta(pdf, df):

Callers

nothing calls this directly

Calls 5

to_numericFunction · 0.90
assert_eqFunction · 0.90
to_dask_arrayMethod · 0.80
astypeMethod · 0.45
computeMethod · 0.45

Tested by

no test coverage detected