how to convert timedelta64[ns] to int? I want to convert timedelta64[ns] to int

timedelta64[ns] example :
01:00:00 , 02:00:00 , 03:00:00 , 04:00:00

I want to convert as : 1, 2 , 3 , 4

Help me please T^T
You can do: 

 t, _ , _ = "01:00:00".split(":")


and then:

int(t)


That will return you: 1.

Putting this together as a function would be:

def time_to_integer(time):
    t, _,_ = time.split(":")
    return int(t)


Please note that you should pass the time variable as string. For example: 

time_to_integer("02:00:00")


Would return: 2