ValueError: Sample is not large enough to include at least one row of data. Please increase the number of bytes in `sample`

Viewed 2464

I am trying to read a csv file(2GB).Since the size is large I used dask but it is showing a ValueError: Sample is not large enough to include at least one row of data. Please increase the number of bytes in sample in the call to read_csv/read_table Can anyone please suggest me how to slove it? Thanks

Code:

import dask.dataframe as dd
df= dd.read_csv('file1.csv')

error:

ValueError: Sample is not large enough to include at least one row of data. Please increase the number of bytes in `sample` in the call to `read_csv`/`read_table`
1 Answers

The error means "please include the optional keyword argument sample in your call to read_csv, giving a value (in bytes) which is large enough to include one row of data". Looking at the function docstring, you'll see that the default value is 256000bytes.

So maybe try

df = dd.read_csv('file1.csv', sample=1000000)
Related