I have another pesky Date issue for you. I have an Excel table with date values, but some values are blank. When I read this data into a DataFrame, the blank rows are recorded as time, not datetime, so ultimately I end up with an colomn of type object which is not convertable to datetime. Python in Excel handles this correctly (datetime), Anaconda Code does not.
The sample data:
Last_Received
10/1/2024
6/29/2023
10/21/2024
6/24/2024
The test code:
df = to_df(REF(“Raw_Data[#All]”))
df = df.convert_dtypes()
print(df.Last_Received.dtype)
for i in range(5):
print(df.Last_Received.iloc[i])
The output:
object
2024-10-01 00:00:00
2023-06-29 00:00:00
00:00:00
2024-10-21 00:00:00
00:00:00