NYC 311 project

Discussion in 'Masters Program - Customers only' started by Ramanpreet kaur, Mar 19, 2020.

  1. Ramanpreet kaur

    Joined:
    Jul 25, 2019
    Messages:
    3
    Likes Received:
    0
    Hi I am trying to get time elapsed which is giving me negative values. i don't know I should ignore them or no. df['Request_Closing_Time']=df['Closed Date']-df['Created Date'] df['Request_Closing_Time']
    0 -5463 days +00:55:15 ( it should have be 5462 days, 23:04:45)
    1 -5463 days +01:26:16
    2 -5463 days +04:51:31
    3 -5463 days +07:45:14
    4 -5463 days +03:27:02
    ...
    300693 NaT
    300694 0 days 02:00:31
    300695 0 days 03:07:17
    300696 0 days 04:05:33
    300697 0 days 04:08:49
    Name: Request_Closing_Time, Length: 300698, dtype: timedelta64[ns]
    df['Request_Closing_Time'].max()
    Timedelta('5462 days 23:12:55') (which is correct)
    df['Request_Closing_Time'].min()
    Timedelta('-3772 days +07:54:34') WRONG SO SYSTEM WOULD BE READING THE OUTPUT INCORRECTLY.
     
    #1

Share This Page