

def test_error(self):
    s = pd.Series([1, (- 3.14), 'apple'])
    assert_raises(ValueError, to_numeric, s, errors='raise')
    res = to_numeric(s, errors='ignore')
    expected = pd.Series([1, (- 3.14), 'apple'])
    tm.assert_series_equal(res, expected)
    res = to_numeric(s, errors='coerce')
    expected = pd.Series([1, (- 3.14), np.nan])
    tm.assert_series_equal(res, expected)

dataset/ETHPy150Open pydata/pandas/pandas/tools/tests/test_util.py TestToNumeric.test_error/original