def _convert_bin_to_numeric_type(x):
 dtype = infer_dtype(x)
 if ((dtype == 'timedelta') or (dtype == 'timedelta64')):
  x = to_timedelta(x).view(np.int64)
 elif ((dtype == 'datetime') or (dtype == 'datetime64')):
  x = to_datetime(x).view(np.int64)
 return x

def _convert_bin_to_numeric_type ( x ) : dtype = infer_dtype ( x ) if ( ( dtype == 'timedelta' ) or ( dtype == 'timedelta64' ) ) : x = to_timedelta ( x ) . view ( np . int64 ) elif ( ( dtype == 'datetime' ) or ( dtype == 'datetime64' ) ) : x = to_datetime ( x ) . view ( np . int64 ) return x
if the passed bin is of datetime/timedelta type .