Skip to content
Advertisement

how to properly apply a vector based function to a pandas dataframe column?

I am trying to apply a function that returns an specific date in an specific format, however I am struggling to apply this function to a new pandas dataframe column.

Here’s what I got so far:

JavaScript

The next error arises:

KeyError: datetime.datetime(2021, 2, 1, 0, 0)

Expected output could be a pandas dataframe column where row-values are set_date output.

How could I accomplish this task?

Advertisement

Answer

The issue was related to the setting of x for lambda:

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement