def _coerce_to_type(x):
dtype = None<EOL>if is_datetime64tz_dtype(x):<EOL><INDENT>dtype = x.dtype<EOL><DEDENT>elif is_datetime64_dtype(x):<EOL><INDENT>x = to_datetime(x)<EOL>dtype = np.dtype('<STR_LIT>')<EOL><DEDENT>elif is_timedelta64_dtype(x):<EOL><INDENT>x = to_timedelta(x)<EOL>dtype = np.dtype('<STR_LIT>')<EOL><DEDENT>if dtype is not None:<EOL><INDENT>x = np.where(x.notna(), x.view(np.int64), np.nan)<EOL><DEDENT>return x, dtype<EOL>
if the passed data is of datetime/timedelta type,
this method converts it to numeric so that cut method can
handle it