How can I do max values in string column like this?
dataframe = pandas.DataFrame.from_dict(
{
"DEPARTMENT_ID": ["A", "B", "A", "B"],
"SLOT_BEGIN_TIME": ["2014-01-01", "2014-01-02", "2014-02-01", "2014-02-02"],
}
)
dataframe["MAX_TIME"] = dataframe.groupby(["DEPARTMENT_ID"])["SLOT_BEGIN_TIME"].max()
I get NaN for dataframe["MAX_TIME"]. If it is not possible to do max on non-numeric series, can I write my own compare function?