Assign list of dict values to column in dask dataframe

Viewed 35

I have a list of dictionaries computed(using pandas) as below. But when I try the same with dask it throwing me a error

df['closingDate'] = [
    {
        'bin': 1,
        'date': row['closingdate'].date(),
        'hour':row['closingdate'].hour,
        'day': row['closingdate'].weekday() + 1,
        'day':row['closingdate'].day,
        'year':(row['closingdate']).year,
        'month'(row['closingdate']).month,
        'quarter':((row['closingdate'].month) // 3) + 1,
        'week':row['closingdate'].week,
    } for idx, row in df.iterrows()
]

results in

TypeError: Column assignment doesn't support type list

Is there any way to achieve the same?

0 Answers
Related