{"action":"created","issue":{"url":"https://api.github.com/repos/dask/dask/issues/1166","repository_url":"https://api.github.com/repos/dask/dask","labels_url":"https://api.github.com/repos/dask/dask/issues/1166/labels{/name}","comments_url":"https://api.github.com/repos/dask/dask/issues/1166/comments","events_url":"https://api.github.com/repos/dask/dask/issues/1166/events","html_url":"https://github.com/dask/dask/issues/1166","id":155417341,"number":1166,"title":"Error with read_csv using dask.dataframe","user":{"login":"koverholt","id":303236,"avatar_url":"https://avatars.githubusercontent.com/u/303236?v=3","gravatar_id":"","url":"https://api.github.com/users/koverholt","html_url":"https://github.com/koverholt","followers_url":"https://api.github.com/users/koverholt/followers","following_url":"https://api.github.com/users/koverholt/following{/other_user}","gists_url":"https://api.github.com/users/koverholt/gists{/gist_id}","starred_url":"https://api.github.com/users/koverholt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/koverholt/subscriptions","organizations_url":"https://api.github.com/users/koverholt/orgs","repos_url":"https://api.github.com/users/koverholt/repos","events_url":"https://api.github.com/users/koverholt/events{/privacy}","received_events_url":"https://api.github.com/users/koverholt/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-05-18T05:05:22Z","updated_at":"2016-05-18T05:19:13Z","closed_at":null,"body":"I get an error when using `dd.read_csv` using Dask 0.9.0. This works with Dask 0.8.2 and pandas 0.18.1. Steps to reproduce are below:\r\n\r\nDownload a sample CSV file from the GDELT dataset:\r\n\r\n```\r\n$ wget https://s3.amazonaws.com/blaze-data/gdelt/csv/20140101.export.csv\r\n```\r\n\r\nPerform an operation with Dask.Dataframe:\r\n\r\n```\r\n>>> import dask.dataframe as dd\r\n>>> df = dd.read_csv('20140101.export.csv', sep='\\t', header=None)\r\n>>> df.head()\r\n\r\nValueError                                Traceback (most recent call last)\r\n<ipython-input-3-2569c44faf66> in <module>()\r\n----> 1 df.head()\r\n\r\n/Users/koverholt/anaconda3/lib/python3.5/site-packages/dask/dataframe/core.py in head(self, n, compute)\r\n    369 \r\n    370         if compute:\r\n--> 371             result = result.compute()\r\n    372         return result\r\n    373 \r\n\r\n/Users/koverholt/anaconda3/lib/python3.5/site-packages/dask/base.py in compute(self, **kwargs)\r\n     35 \r\n     36     def compute(self, **kwargs):\r\n---> 37         return compute(self, **kwargs)[0]\r\n     38 \r\n     39     @classmethod\r\n\r\n/Users/koverholt/anaconda3/lib/python3.5/site-packages/dask/base.py in compute(*args, **kwargs)\r\n    108                 for opt, val in groups.items()])\r\n    109     keys = [var._keys() for var in variables]\r\n--> 110     results = get(dsk, keys, **kwargs)\r\n    111 \r\n    112     results_iter = iter(results)\r\n\r\n/Users/koverholt/anaconda3/lib/python3.5/site-packages/dask/threaded.py in get(dsk, result, cache, num_workers, **kwargs)\r\n     55     results = get_async(pool.apply_async, len(pool._pool), dsk, result,\r\n     56                         cache=cache, queue=queue, get_id=_thread_get_id,\r\n---> 57                         **kwargs)\r\n     58 \r\n     59     return results\r\n\r\n/Users/koverholt/anaconda3/lib/python3.5/site-packages/dask/async.py in get_async(apply_async, num_workers, dsk, result, cache, queue, get_id, raise_on_exception, rerun_exceptions_locally, callbacks, **kwargs)\r\n    486                 _execute_task(task, data)  # Re-execute locally\r\n    487             else:\r\n--> 488                 raise(remote_exception(res, tb))\r\n    489         state['cache'][key] = res\r\n    490         finish_task(dsk, key, state, results, keyorder.get)\r\n\r\nValueError: could not convert string to float: 'HRW'\r\n\r\nTraceback\r\n---------\r\n  File \"/Users/koverholt/anaconda3/lib/python3.5/site-packages/dask/async.py\", line 267, in execute_task\r\n    result = _execute_task(task, data)\r\n  File \"/Users/koverholt/anaconda3/lib/python3.5/site-packages/dask/async.py\", line 249, in _execute_task\r\n    return func(*args2)\r\n  File \"/Users/koverholt/anaconda3/lib/python3.5/site-packages/dask/dataframe/csv.py\", line 43, in bytes_read_csv\r\n    coerce_dtypes(df, dtypes)\r\n  File \"/Users/koverholt/anaconda3/lib/python3.5/site-packages/dask/dataframe/csv.py\", line 67, in coerce_dtypes\r\n    df[c] = df[c].astype(dtypes[c])\r\n  File \"/Users/koverholt/anaconda3/lib/python3.5/site-packages/pandas/core/generic.py\", line 2950, in astype\r\n    raise_on_error=raise_on_error, **kwargs)\r\n  File \"/Users/koverholt/anaconda3/lib/python3.5/site-packages/pandas/core/internals.py\", line 2938, in astype\r\n    return self.apply('astype', dtype=dtype, **kwargs)\r\n  File \"/Users/koverholt/anaconda3/lib/python3.5/site-packages/pandas/core/internals.py\", line 2890, in apply\r\n    applied = getattr(b, f)(**kwargs)\r\n  File \"/Users/koverholt/anaconda3/lib/python3.5/site-packages/pandas/core/internals.py\", line 434, in astype\r\n    values=values, **kwargs)\r\n  File \"/Users/koverholt/anaconda3/lib/python3.5/site-packages/pandas/core/internals.py\", line 477, in _astype\r\n    values = com._astype_nansafe(values.ravel(), dtype, copy=True)\r\n  File \"/Users/koverholt/anaconda3/lib/python3.5/site-packages/pandas/core/common.py\", line 1920, in _astype_nansafe\r\n    return arr.astype(dtype)\r\n```\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/dask/dask/issues/comments/219927683","html_url":"https://github.com/dask/dask/issues/1166#issuecomment-219927683","issue_url":"https://api.github.com/repos/dask/dask/issues/1166","id":219927683,"user":{"login":"mrocklin","id":306380,"avatar_url":"https://avatars.githubusercontent.com/u/306380?v=3","gravatar_id":"","url":"https://api.github.com/users/mrocklin","html_url":"https://github.com/mrocklin","followers_url":"https://api.github.com/users/mrocklin/followers","following_url":"https://api.github.com/users/mrocklin/following{/other_user}","gists_url":"https://api.github.com/users/mrocklin/gists{/gist_id}","starred_url":"https://api.github.com/users/mrocklin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrocklin/subscriptions","organizations_url":"https://api.github.com/users/mrocklin/orgs","repos_url":"https://api.github.com/users/mrocklin/repos","events_url":"https://api.github.com/users/mrocklin/events{/privacy}","received_events_url":"https://api.github.com/users/mrocklin/received_events","type":"User","site_admin":false},"created_at":"2016-05-18T05:19:13Z","updated_at":"2016-05-18T05:19:13Z","body":"I'm not sure how to solve this problem generally.\r\n\r\nWe could increase the default sample size to read when determining initial dtypes.  We could also improve error messages."}}