{"action":"created","issue":{"url":"https://api.github.com/repos/pydata/pandas/issues/10205","labels_url":"https://api.github.com/repos/pydata/pandas/issues/10205/labels{/name}","comments_url":"https://api.github.com/repos/pydata/pandas/issues/10205/comments","events_url":"https://api.github.com/repos/pydata/pandas/issues/10205/events","html_url":"https://github.com/pydata/pandas/issues/10205","id":80372256,"number":10205,"title":"read_csv() fills empty string with nan","user":{"login":"ronanpaixao","id":7624997,"avatar_url":"https://avatars.githubusercontent.com/u/7624997?v=3","gravatar_id":"","url":"https://api.github.com/users/ronanpaixao","html_url":"https://github.com/ronanpaixao","followers_url":"https://api.github.com/users/ronanpaixao/followers","following_url":"https://api.github.com/users/ronanpaixao/following{/other_user}","gists_url":"https://api.github.com/users/ronanpaixao/gists{/gist_id}","starred_url":"https://api.github.com/users/ronanpaixao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ronanpaixao/subscriptions","organizations_url":"https://api.github.com/users/ronanpaixao/orgs","repos_url":"https://api.github.com/users/ronanpaixao/repos","events_url":"https://api.github.com/users/ronanpaixao/events{/privacy}","received_events_url":"https://api.github.com/users/ronanpaixao/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-05-25T03:46:27Z","updated_at":"2015-05-25T05:16:14Z","closed_at":null,"body":"Pandas stores strings (str and unicode) with dtype=object. As such, some unexpected things happen, like empty fields being filled with nan, which is a float. Expected behavior should fill with empty string \"\" or at least None.\r\n\r\n```\r\n>>> import pandas as pd\r\n>>> from StringIO import StringIO\r\n>>> pd.read_csv(StringIO('col1,col2,col3\\nfoo,,bar'),dtype=str)\r\n  col1 col2 col3\r\n0  foo  NaN  bar\r\n>>> type(pd.read_csv(StringIO('col1,col2,col3\\nfoo,,bar'),dtype=str).iloc[0,1])\r\nfloat"},"comment":{"url":"https://api.github.com/repos/pydata/pandas/issues/comments/105128258","html_url":"https://github.com/pydata/pandas/issues/10205#issuecomment-105128258","issue_url":"https://api.github.com/repos/pydata/pandas/issues/10205","id":105128258,"user":{"login":"shoyer","id":1217238,"avatar_url":"https://avatars.githubusercontent.com/u/1217238?v=3","gravatar_id":"","url":"https://api.github.com/users/shoyer","html_url":"https://github.com/shoyer","followers_url":"https://api.github.com/users/shoyer/followers","following_url":"https://api.github.com/users/shoyer/following{/other_user}","gists_url":"https://api.github.com/users/shoyer/gists{/gist_id}","starred_url":"https://api.github.com/users/shoyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shoyer/subscriptions","organizations_url":"https://api.github.com/users/shoyer/orgs","repos_url":"https://api.github.com/users/shoyer/repos","events_url":"https://api.github.com/users/shoyer/events{/privacy}","received_events_url":"https://api.github.com/users/shoyer/received_events","type":"User","site_admin":false},"created_at":"2015-05-25T05:16:14Z","updated_at":"2015-05-25T05:16:14Z","body":"I know it may seem a little strange, but pandas actually uses NaN intentionally in string arrays, as a marker for missing values. The pandas [string methods](http://pandas.pydata.org/pandas-docs/stable/text.html) will skip NaN, and likewise we use it for methods like `isnull`, `fillna` and `dropna`.\r\n\r\nIf you'd like to replace them with another value, try `df.fillna('')`."}}