You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a user specifies that a column should use the DatetimeTransformer, we should attempt to cast the column as datetime if it isn't already. Sometimes when data is loaded in pandas, datetime columns have a dtype of object and the DatetimeTransformer doesn't work on it.
Expected behavior
Here is an example using the student_placements dataset.
fromrdt.transformersimportDatetimeTransformerht=HyperTransformer()
students=pd.read_csv('student_placements/student_placements.csv')
students
As you can see, currently all the date values are being read as null and the transformer doesn't work, even though the values in the data could definitely be cast as datetime.
Problem Description
If a user specifies that a column should use the
DatetimeTransformer
, we should attempt to cast the column as datetime if it isn't already. Sometimes when data is loaded in pandas, datetime columns have adtype
ofobject
and theDatetimeTransformer
doesn't work on it.Expected behavior
Here is an example using the
student_placements
dataset.As you can see, currently all the date values are being read as null and the transformer doesn't work, even though the values in the data could definitely be cast as
datetime
.The desired result would be as follows:
Additional context
This happens because the
dtype
for thestart_date
andend_date
column isobject
by default. You can check this by runningThe text was updated successfully, but these errors were encountered: