Fix Index __mul__-like ops with timedelta scalars
State: closed

Fixes the following current behavior for each of the numeric index classes and each of the basic timedelta-like scalars:

```
idx = pd.Index(range(3))
td = pd.Timedelta(days=1)

>>> idx * td
TypeError: can only perform ops with timedelta like values
>>> td * idx
TypeError: can only perform ops with timedelta like values
>>> td / idx
TypeError: can only perform ops with timedelta like values
>>> td // idx
TypeError: can only perform ops with timedelta like values
```

- [ ] closes #xxxx
- [x] tests added / passed
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry


Labels:
name: Timedelta
description: Timedelta data type
name: Compat
description: pandas objects compatability with Numpy or Python functions

Comments:
I just updated the whatsnew, to be more organized, so rebase again.
OK.  Should I put the multiplication/division stuff in Numeric instead of Conversion?  A few days back you suggested an Ops section, but I wasn't clear on what the scope of that would be.
I would put this in datetimelike, numeric is for well, numeric types! this is sort of an arbitrary split but  makes each section shorter
Any idea what's special about the circleCI setup?  I can't replicate the error there.
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/19333?src=pr&el=h1) Report
> Merging [#19333](https://codecov.io/gh/pandas-dev/pandas/pull/19333?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/aa59954a217c8f856bb0980265520d37b85a80af?src=pr&el=desc) will **decrease** coverage by `0.02%`.
> The diff coverage is `95.23%`.

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

```diff
@@            Coverage Diff             @@
##           master   #19333      +/-   ##
==========================================
- Coverage   91.61%   91.59%   -0.03%     
==========================================
  Files         150      150              
  Lines       48892    48911      +19     
==========================================
+ Hits        44792    44798       +6     
- Misses       4100     4113      +13
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `89.96% <95.23%> (-0.03%)` | :arrow_down: |
| #single | `41.77% <14.28%> (-0.02%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/19333?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/indexes/range.py](https://codecov.io/gh/pandas-dev/pandas/pull/19333/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy9yYW5nZS5weQ==) | `95.74% <100%> (+0.09%)` | :arrow_up: |
| [pandas/core/indexes/base.py](https://codecov.io/gh/pandas-dev/pandas/pull/19333/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy9iYXNlLnB5) | `96.41% <92.3%> (-0.04%)` | :arrow_down: |
| [pandas/plotting/\_converter.py](https://codecov.io/gh/pandas-dev/pandas/pull/19333/diff?src=pr&el=tree#diff-cGFuZGFzL3Bsb3R0aW5nL19jb252ZXJ0ZXIucHk=) | `65.22% <0%> (-1.74%)` | :arrow_down: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/19333?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/19333?src=pr&el=footer). Last update [aa59954...9e3dec4](https://codecov.io/gh/pandas-dev/pandas/pull/19333?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

@gfyoung any wisdom to offer about what makes circleci config special?
> any wisdom to offer about what makes circleci config special?

@jbrockmendel : I wish 😉  I've generally found Circle and AppVeyor to be more PITA than Travis due to weird failures like these.  AFAIK, Travis and Circle are quite similar, so unless you have some kind of flakiness in your tests, I'm not 100% sure why you are getting these results.
@gfyoung OK thanks.  I'd rebase and re-push and hope that it sorts itself out, but don't want to put the strain on Travis.
> but don't want to put the strain on Travis.

@jbrockmendel : No worries.  I'm still kind of perplexed why Circle gets the completely wrong result when doing such a simple operation.
looks fine. ping when all green.
ping
you neesnt reproduce this locally and see what the problem is

this is a bug 
> you neesnt reproduce this locally and see what the problem is

> this is a bug

Right... Any ideas on how to reproduce?  For instance, what is special about the CircleCI config that makes it only show up there?
well it’s a 2.7 build that sets locale 
I'm nowhere on this.  Absent a better suggestion or someone else taking a swing at fixing the CircleCI failure, my only ideas are a) keep the xfail in the PR or b) revert the fix for RangeIndex so it stays broken.  I like a) a lot more than b), but am open to ideas.
This is 
not
now a blocker for fixing #19123.
needs a rebase. IIRC the circle ci failure is on py2.7 
@gfyoung thoughts on how to handle the CircleCI/xfail conundrum?
Looks like it is setting local to it_IT.UTF-8.  From the circleCI log (link above)

```
export LOCALE_OVERRIDE=it_IT.UTF-8
[Adding locale to the first line of pandas/__init__.py]
[head -4 pandas/__init__.py]
# pylint: disable-msg=W0614,W0401,W0611,W0622

import locale
locale.setlocale(locale.LC_ALL, 'it_IT.UTF-8')
```

I'll see if setting that locally recreates the error...
No dice.
so you *can* ssh to a CIrcleCI machine and see what's going on. you prob need to have a login. I am being a sticker on this issue because I have seen things like this be actual errors.
OK.  Should I send a public key somewhere?
look on circleci on how to do this
https://circleci.com/docs/2.0/ssh-access-jobs/

Looks like I need to send you a public key and have you authorize it for me to debug.
you simply need to sign up on CircleCI, then you can run personal builds.
@gfyoung I made it onto CircleCI but couldn't replicate the test failure.  Can I impose on you to give it a try?  There's a beer and a high-five in it for you if that helps.
@jbrockmendel : Can you push those to me on GitHub? 😄   I restarted both AppVeyor and Circle for you.  That being said, not sure yet what's causing the discrepancy.  Might be something architecturally-related (e.g. `int32` vs. `int64`).
Oh is it a 32 bit build thats broken?  I hadn't noticed that.
small comments, is there an issue about this (or just PR)? rebase and ping on green.
> small comments, is there an issue about this (or just PR)? rebase and ping on green.

Just the PR I think.

My attempt to SSH into CircleCI to debug the weird failing test failed.  I'll try again at some point, hoping a fresh pair of eyeballs takes a crack at it in the interim.