For the entire data frame I need to compare 4 dates all on the same row. Find the latest date and highlight it. The highlighted cell is the highest between comp1 - comp4.
The output I need will look like this:
I started by making sure all comps were date times dtypes and I even tried making them objects and comparing them before writing this but with no luck.
Here is what I have tried/searched on line for but none of these work:
checks.style.highlight_max(color= 'yellow', axis=0)
Nothing gets highlighted
I also tried to use subsets but for some reason no matter if check the dtypes on each comp they non not stay a date time or an object but instead become a float for some odd reason
checks.style.highlight_max(color= 'yellow', axis=0, subset=['CAC Clearance', 'ASB Results Received','Arch Assessment','Bio Assessment'])
This is the error i get but I have them all as date times before I run it.
TypeError: '>=' not supported between instances of 'float' and 'datetime.date'
Lastly I tried to do a groupby the ID and even that way I cant not seem to get it to work.
example date using print(checks.head().to_records())/print(checks.head().to_dict())
outputs (only can give certain info for now timestamps)
TypeError Traceback (most recent call last) in ----> 1 print(checks.head().to_records())/print(checks.head().to_dict())
TypeError: unsupported operand type(s) for /: 'NoneType' and 'NoneType'
1st print example:
'2021-10-13T00:00:00.000000000', '2021-10-13T00:00:00.000000000')
2nd print example:
Timestamp('2021-10-13 00:00:00'), 4: Timestamp('2021-10-13 00:00:00')}, 'Bio Assessment': {0: Timestamp('2021-10-13 00:00:00'), 1: Timestamp('2021-10-14 00:00:00'), 2: Timestamp('2021-10-13 00:00:00'), 3: Timestamp('2021-10-13 00:00:00'), 4: Timestamp('2021-10-13 00:00:00')}}