BUG: DatetimeIndex + arraylike of DateOffsets
State: closed

Before:

```
>>> dti = pd.date_range('2017-01-01', periods=2)
>>> other = np.array([pd.offsets.MonthEnd(), pd.offsets.Day(n=2)])

>>> dti + other
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: ufunc add cannot use operands with types dtype('<M8[ns]') and dtype('O')

# Same for `dti - other`, `dti + pd.Index(other)`, `dti - pd.Index(other)`

>>> dti + pd.Series(other)
0    DatetimeIndex(['2017-01-31', '2017-01-31'], dt...
1    DatetimeIndex(['2017-01-03', '2017-01-04'], dt...
dtype: object

# yikes.
```

After:
```
>>> dti + other
pandas/core/indexes/datetimelike.py:677: PerformanceWarning: Adding/subtracting array of DateOffsets to <class 'pandas.core.indexes.datetimes.DatetimeIndex'> not vectorized
  PerformanceWarning)
DatetimeIndex(['2017-01-31', '2017-01-04'], dtype='datetime64[ns]', freq=None)

>>> dti - pd.Index(other)
DatetimeIndex(['2016-12-31', '2016-12-31'], dtype='datetime64[ns]', freq=None)

>>> dti + pd.Series(other)
0   2017-01-31
1   2017-01-04
dtype: datetime64[ns]

```

<b>Caveat</b> This will need a follow-up to make sure `name` attribute is propogated correctly.

- [ ] closes #xxxx
- [x] tests added / passed
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry


Labels:
name: Bug
name: Datetime
description: Datetime data dtype
name: Frequency
description: DateOffsets

Comments:
@jbrockmendel : As this PR stands, I'm a little uneasy about it.  Besides the `name` bug that you mention as a "caveat," the fact that you have that `PerformanceWarning`, while not *super problematic*, is still a little bothersome.
> the fact that you have that PerformanceWarning, while not super problematic, is still a little bothersome.

This is explicitly copying the Series behavior.
> This is explicitly copying the Series behavior.

Hmmm...I see.  Theoretically, it makes sense.  Though if we can avoid adding this warning, that would be great.  Thus, either you can confirm that there is indeed a performance difference OR the code is rewritten so that we avoid this overhead.
> Thus, either you can confirm that there is indeed a performance difference OR the code is rewritten so that we avoid this overhead

I've been working on offsets a lot recently (and upcoming, see #18854).  Perf has improved quite a bit, but I can absolutely confirm that this is not a speedy operation.
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/18849?src=pr&el=h1) Report
> Merging [#18849](https://codecov.io/gh/pandas-dev/pandas/pull/18849?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/dbec3c92e08063d247e0d28937c8695bbd66fe94?src=pr&el=desc) will **decrease** coverage by `0.02%`.
> The diff coverage is `90.32%`.

[![Impacted file tree graph](https://codecov.io/gh/pandas-dev/pandas/pull/18849/graphs/tree.svg?src=pr&token=eZ4WkYLtcO&width=650&height=150)](https://codecov.io/gh/pandas-dev/pandas/pull/18849?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##           master   #18849      +/-   ##
==========================================
- Coverage    91.6%   91.58%   -0.03%     
==========================================
  Files         150      150              
  Lines       48939    48966      +27     
==========================================
+ Hits        44833    44845      +12     
- Misses       4106     4121      +15
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `89.94% <90.32%> (-0.03%)` | :arrow_down: |
| #single | `41.72% <19.35%> (+0.55%)` | :arrow_up: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/18849?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/ops.py](https://codecov.io/gh/pandas-dev/pandas/pull/18849/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvb3BzLnB5) | `90.24% <100%> (+0.03%)` | :arrow_up: |
| [pandas/core/indexes/datetimes.py](https://codecov.io/gh/pandas-dev/pandas/pull/18849/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy9kYXRldGltZXMucHk=) | `95.45% <86.66%> (-0.13%)` | :arrow_down: |
| [pandas/core/indexes/datetimelike.py](https://codecov.io/gh/pandas-dev/pandas/pull/18849/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy9kYXRldGltZWxpa2UucHk=) | `97.04% <92.3%> (-0.16%)` | :arrow_down: |
| [pandas/core/indexes/interval.py](https://codecov.io/gh/pandas-dev/pandas/pull/18849/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy9pbnRlcnZhbC5weQ==) | `92.61% <0%> (-1.21%)` | :arrow_down: |
| [pandas/core/sparse/array.py](https://codecov.io/gh/pandas-dev/pandas/pull/18849/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvc3BhcnNlL2FycmF5LnB5) | `91.82% <0%> (-0.47%)` | :arrow_down: |
| [pandas/util/testing.py](https://codecov.io/gh/pandas-dev/pandas/pull/18849/diff?src=pr&el=tree#diff-cGFuZGFzL3V0aWwvdGVzdGluZy5weQ==) | `84.68% <0%> (-0.22%)` | :arrow_down: |
| [pandas/core/dtypes/cast.py](https://codecov.io/gh/pandas-dev/pandas/pull/18849/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZHR5cGVzL2Nhc3QucHk=) | `88.42% <0%> (-0.18%)` | :arrow_down: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/18849?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/18849?src=pr&el=footer). Last update [dbec3c9...81c4fbf](https://codecov.io/gh/pandas-dev/pandas/pull/18849?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

thanks!