'Get age from DOB - Dask
How would I include a new column called "Age_cust" when I have a a "DOB" column?
from datetime import date
today = date.today()
ddf = ddf.assign(Age_cust=cust.map_partitions(lambda x: x['DOB'] - today))
From this I get the error
ValueError: Metadata inference failed in `lambda`.
You have supplied a custom function and Dask is unable to
determine the type of output that that function returns.
To resolve this please provide a meta= keyword.
The docstring of the Dask function you ran should have more information.
Original error is below:
------------------------
TypeError("unsupported operand type(s) for -: 'DatetimeArray' and 'datetime.date'")
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
