{"action":"created","issue":{"url":"https://api.github.com/repos/pydata/pandas/issues/9589","labels_url":"https://api.github.com/repos/pydata/pandas/issues/9589/labels{/name}","comments_url":"https://api.github.com/repos/pydata/pandas/issues/9589/comments","events_url":"https://api.github.com/repos/pydata/pandas/issues/9589/events","html_url":"https://github.com/pydata/pandas/issues/9589","id":59858439,"number":9589,"title":"BUG: convert_objects(convert_numeric=True) fails with all strings","user":{"login":"bashtage","id":5585221,"avatar_url":"https://avatars.githubusercontent.com/u/5585221?v=3","gravatar_id":"","url":"https://api.github.com/users/bashtage","html_url":"https://github.com/bashtage","followers_url":"https://api.github.com/users/bashtage/followers","following_url":"https://api.github.com/users/bashtage/following{/other_user}","gists_url":"https://api.github.com/users/bashtage/gists{/gist_id}","starred_url":"https://api.github.com/users/bashtage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bashtage/subscriptions","organizations_url":"https://api.github.com/users/bashtage/orgs","repos_url":"https://api.github.com/users/bashtage/repos","events_url":"https://api.github.com/users/bashtage/events{/privacy}","received_events_url":"https://api.github.com/users/bashtage/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/pydata/pandas/labels/API%20Design","name":"API Design","color":"AD7FA8"},{"url":"https://api.github.com/repos/pydata/pandas/labels/Dtypes","name":"Dtypes","color":"e102d8"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-03-04T20:40:53Z","updated_at":"2015-05-05T21:27:07Z","closed_at":null,"body":"```\r\ns=pd.Series(['a','a','a'])\r\n\r\ns.convert_objects(convert_numeric=True)\r\nOut[78]: \r\n0    a\r\n1    a\r\n2    a\r\ndtype: object\r\n\r\ns[0]=1.0\r\n\r\ns\r\nOut[80]: \r\n0    1\r\n1    a\r\n2    a\r\ndtype: object\r\n\r\ns.convert_objects(convert_numeric=True)\r\nOut[81]: \r\n0     1\r\n1   NaN\r\n2   NaN\r\ndtype: float64\r\n```\r\n\r\nHaving a single number changes behavior.  Makes `convert_objects` unreliable when the data type must be numeric."},"comment":{"url":"https://api.github.com/repos/pydata/pandas/issues/comments/99227868","html_url":"https://github.com/pydata/pandas/issues/9589#issuecomment-99227868","issue_url":"https://api.github.com/repos/pydata/pandas/issues/9589","id":99227868,"user":{"login":"detroitcoder","id":6266683,"avatar_url":"https://avatars.githubusercontent.com/u/6266683?v=3","gravatar_id":"","url":"https://api.github.com/users/detroitcoder","html_url":"https://github.com/detroitcoder","followers_url":"https://api.github.com/users/detroitcoder/followers","following_url":"https://api.github.com/users/detroitcoder/following{/other_user}","gists_url":"https://api.github.com/users/detroitcoder/gists{/gist_id}","starred_url":"https://api.github.com/users/detroitcoder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/detroitcoder/subscriptions","organizations_url":"https://api.github.com/users/detroitcoder/orgs","repos_url":"https://api.github.com/users/detroitcoder/repos","events_url":"https://api.github.com/users/detroitcoder/events{/privacy}","received_events_url":"https://api.github.com/users/detroitcoder/received_events","type":"User","site_admin":false},"created_at":"2015-05-05T21:27:07Z","updated_at":"2015-05-05T21:27:07Z","body":"What about using `convert_object` on a field of strings where only one of the fields can be converted to a numeric?\r\n\r\n eg. \r\n\r\n    converted_df = DataFrame(list(\"abc1xyz\")).convert_objects(convert_numeric=True)\r\n    converted_df.info()\r\n    >> class 'pandas.core.frame.DataFrame'>\r\n    Int64Index: 7 entries, 0 to 6\r\n    Data columns (total 1 columns):\r\n    0    1 non-null float64\r\n    dtypes: float64(1)\r\n\r\nOnly one numeric value will force this field to float64, set all strings to null, and convert the rest to floats. This seems a bit more like black magic."}}