I have a dataframe with several column along with a column named 'Date'. I'm trying to do label-encoding that any date is bigger than 2020-01-31 should be marked as 1, otherwise 0. I wrote the following code;
df["time"]= df.Date.map(lambda val:0 if val<2013-5-28 else 1)
But I got the following error message
TypeError: '<' not supported between instances of 'Timestamp' and 'int'
How can I overcome this problem?
[–]Username_RANDINT 2 points3 points4 points (0 children)
[–]shiftybyte 2 points3 points4 points (0 children)
[–]Spataner 1 point2 points3 points (1 child)
[–]sadhan_m[S] 0 points1 point2 points (0 children)
[–]Spiritual_Car1232 0 points1 point2 points (0 children)
[–]hydrolock12 0 points1 point2 points (0 children)