Can I set the index column when reading a CSV using Python dask? -
when using python pandas read csv possible specify index column. possible using python dask when reading file, opposed setting index afterwards?
for example, using pandas:
df = pandas.read_csv(filename, index_col=0)
ideally using dask be:
df = dask.dataframe.read_csv(filename, index_col=0)
i have tried
df = dask.dataframe.read_csv(filename).set_index(?)
but index column not have name (and seems slow).
no, these need 2 separate methods. if try dask tell in nice error message.
in [1]: import dask.dataframe dd in [2]: df = dd.read_csv('*.csv', index='my-index') valueerror: keyword 'index' not supported dd.read_csv(...).set_index('my-index') instead
but won't slower or faster doing other way.
Comments
Post a Comment