code: def transform(x):
          
          # microseconds
          try:
              x = np.array([_x.total_seconds()*10**6 for _x in x])
          except TypeError:
              x = x.total_seconds()*10**6
          return x
docs: Transform from Timeddelta to numerical format