def _cast_values_for_fillna(values, dtype):
<EOL>if (is_datetime64_dtype(dtype) or is_datetime64tz_dtype(dtype) or<EOL>is_timedelta64_dtype(dtype)):<EOL><INDENT>values = values.view(np.int64)<EOL><DEDENT>elif is_integer_dtype(values):<EOL><INDENT>values = ensure_float64(values)<EOL><DEDENT>return values<EOL>
Cast values to a dtype that algos.pad and algos.backfill can handle.