I have two fields in a dataframe, both of which are datetime64[ns]
I thought I could just do this...
df_hist['MonthsBetween'] = (df_hist.Last_Date - df_hist.Begin_Time) / pd.Timedelta(months=1)
One field has only a data and one has a date/time, but both are of datatype datetime64[ns]. I Googled this and it seems like it should work, but I'm getting an error message saying:
TypeError: '<' not supported between instances of 'str' and 'int'
I thought these were both datetime64[ns], and neither str or int.