I have a data Frame, and I am doing the following:
def calculate_planungsphase(audit, phase1, phase2):
datum_first_milestone = data_audit[(data_audit.Audit == audit) & (data_audit.Meilenstein == phase1)]
datum_second_milestone = data_audit[(data_audit.Audit == audit) & (data_audit.Meilenstein == phase2)]
print(datum_first_milestone['GeplantesErledigungsdatum'])
print(datum_second_milestone['GeplantesErledigungsdatum'])
print(datum_first_milestone['GeplantesErledigungsdatum'] - datum_second_milestone['GeplantesErledigungsdatum'])
The result of print(datum_first_milestone['GeplantesErledigungsdatum']) =
2018-01-01 Name: GeplantesErledigungsdatum, dtype: datetime64[ns]
The result of print(datum_second_milestone['GeplantesErledigungsdatum']) =
2018-01-02 Name: GeplantesErledigungsdatum, dtype: datetime64[ns]
The result of the difference calculation is:
0 NaT 1 NaT Name: GeplantesErledigungsdatum, dtype: timedelta64[ns
Why is the result of the calculation NaT? And why do i have two results, when I am doing only one calculation? (Index 0 and Index 1 = NaT)
Thank you for your help!