Using to_datetime method in Dask on string similar to pandas

Viewed 173

I have case where I am creating pandas Timestamp object from string '2021-10-19 09:13:25.091'. simple pd.to_datetime('2021-10-19 09:13:25.091') returns TIMESTAMP object. As moving to DASK tried doing same as follow with: https://docs.dask.org/en/latest/generated/dask.dataframe.to_datetime.html

import dask.dataframe as dd

logtimestamp = '2021-10-19 09:13:25.091'

print(dd.to_datetime(logtimestamp))

But it raise exception: dask.dataframe.to_datetime does not support non-indexable arguments.

However as per document: https://docs.dask.org/en/latest/generated/dask.dataframe.to_datetime.html

Parameters accepted are argint, float, str, datetime, list, tuple, 1-d array, Series, DataFrame/dict-like

I am probably interpreting it wrong. Appreciate any help on this.

1 Answers

The Dask documentation page that you've linked to seems to be copied from pandas.to_datetime. (Many dask docstring are, eg: this one).

There will be inconsistencies in to_datetime here and not everything in the docs page might be implemented in Dask. In your example, the NotImplementedError error is raised, which suggests this functionality doesn't exist in Dask.

Related