STY: avoid backslash
State: closed

Related: #11954.

This gets most of the non-`textwrap.dedent` cases.

Labels:
name: Code Style
description: Code style, linting, code_checks

Comments:
Hello @jbrockmendel! Thanks for updating the PR.

 - In the file [`pandas/compat/numpy/__init__.py`](https://github.com/jbrockmendel/pandas/blob/59f45511f0015e7bf390a22f269cce8fc5036ec0/pandas/compat/numpy/__init__.py), following                are the PEP8 issues :
> [Line 63:17](https://github.com/jbrockmendel/pandas/blob/59f45511f0015e7bf390a22f269cce8fc5036ec0/pandas/compat/numpy/__init__.py#L63): [W504](https://duckduckgo.com/?q=pep8%20W504) line break after binary operator


 - There are no PEP8 issues in the file [`pandas/core/algorithms.py`](https://github.com/jbrockmendel/pandas/blob/59f45511f0015e7bf390a22f269cce8fc5036ec0/pandas/core/algorithms.py) !

 - In the file [`pandas/core/base.py`](https://github.com/jbrockmendel/pandas/blob/59f45511f0015e7bf390a22f269cce8fc5036ec0/pandas/core/base.py), following                are the PEP8 issues :
> [Line 398:27](https://github.com/jbrockmendel/pandas/blob/59f45511f0015e7bf390a22f269cce8fc5036ec0/pandas/core/base.py#L398): [W504](https://duckduckgo.com/?q=pep8%20W504) line break after binary operator


 - There are no PEP8 issues in the file [`pandas/core/generic.py`](https://github.com/jbrockmendel/pandas/blob/59f45511f0015e7bf390a22f269cce8fc5036ec0/pandas/core/generic.py) !

 - There are no PEP8 issues in the file [`pandas/core/groupby/generic.py`](https://github.com/jbrockmendel/pandas/blob/59f45511f0015e7bf390a22f269cce8fc5036ec0/pandas/core/groupby/generic.py) !

 - In the file [`pandas/core/groupby/groupby.py`](https://github.com/jbrockmendel/pandas/blob/59f45511f0015e7bf390a22f269cce8fc5036ec0/pandas/core/groupby/groupby.py), following                are the PEP8 issues :
> [Line 581:21](https://github.com/jbrockmendel/pandas/blob/59f45511f0015e7bf390a22f269cce8fc5036ec0/pandas/core/groupby/groupby.py#L581): [W504](https://duckduckgo.com/?q=pep8%20W504) line break after binary operator
> [Line 1557:17](https://github.com/jbrockmendel/pandas/blob/59f45511f0015e7bf390a22f269cce8fc5036ec0/pandas/core/groupby/groupby.py#L1557): [W504](https://duckduckgo.com/?q=pep8%20W504) line break after binary operator


 - In the file [`pandas/core/groupby/grouper.py`](https://github.com/jbrockmendel/pandas/blob/59f45511f0015e7bf390a22f269cce8fc5036ec0/pandas/core/groupby/grouper.py), following                are the PEP8 issues :
> [Line 160:21](https://github.com/jbrockmendel/pandas/blob/59f45511f0015e7bf390a22f269cce8fc5036ec0/pandas/core/groupby/grouper.py#L160): [W504](https://duckduckgo.com/?q=pep8%20W504) line break after binary operator
> [Line 533:13](https://github.com/jbrockmendel/pandas/blob/59f45511f0015e7bf390a22f269cce8fc5036ec0/pandas/core/groupby/grouper.py#L533): [W504](https://duckduckgo.com/?q=pep8%20W504) line break after binary operator
> [Line 534:13](https://github.com/jbrockmendel/pandas/blob/59f45511f0015e7bf390a22f269cce8fc5036ec0/pandas/core/groupby/grouper.py#L534): [W504](https://duckduckgo.com/?q=pep8%20W504) line break after binary operator


 - In the file [`pandas/core/groupby/ops.py`](https://github.com/jbrockmendel/pandas/blob/59f45511f0015e7bf390a22f269cce8fc5036ec0/pandas/core/groupby/ops.py), following                are the PEP8 issues :
> [Line 524:17](https://github.com/jbrockmendel/pandas/blob/59f45511f0015e7bf390a22f269cce8fc5036ec0/pandas/core/groupby/ops.py#L524): [W504](https://duckduckgo.com/?q=pep8%20W504) line break after binary operator


 - In the file [`pandas/core/indexing.py`](https://github.com/jbrockmendel/pandas/blob/59f45511f0015e7bf390a22f269cce8fc5036ec0/pandas/core/indexing.py), following                are the PEP8 issues :
> [Line 1839:21](https://github.com/jbrockmendel/pandas/blob/59f45511f0015e7bf390a22f269cce8fc5036ec0/pandas/core/indexing.py#L1839): [W504](https://duckduckgo.com/?q=pep8%20W504) line break after binary operator
> [Line 1850:29](https://github.com/jbrockmendel/pandas/blob/59f45511f0015e7bf390a22f269cce8fc5036ec0/pandas/core/indexing.py#L1850): [W504](https://duckduckgo.com/?q=pep8%20W504) line break after binary operator


 - In the file [`pandas/core/internals/concat.py`](https://github.com/jbrockmendel/pandas/blob/59f45511f0015e7bf390a22f269cce8fc5036ec0/pandas/core/internals/concat.py), following                are the PEP8 issues :
> [Line 187:25](https://github.com/jbrockmendel/pandas/blob/59f45511f0015e7bf390a22f269cce8fc5036ec0/pandas/core/internals/concat.py#L187): [W504](https://duckduckgo.com/?q=pep8%20W504) line break after binary operator


 - In the file [`pandas/core/reshape/pivot.py`](https://github.com/jbrockmendel/pandas/blob/59f45511f0015e7bf390a22f269cce8fc5036ec0/pandas/core/reshape/pivot.py), following                are the PEP8 issues :
> [Line 143:13](https://github.com/jbrockmendel/pandas/blob/59f45511f0015e7bf390a22f269cce8fc5036ec0/pandas/core/reshape/pivot.py#L143): [W504](https://duckduckgo.com/?q=pep8%20W504) line break after binary operator


 - There are no PEP8 issues in the file [`pandas/core/reshape/reshape.py`](https://github.com/jbrockmendel/pandas/blob/59f45511f0015e7bf390a22f269cce8fc5036ec0/pandas/core/reshape/reshape.py) !

 - There are no PEP8 issues in the file [`pandas/core/tools/datetimes.py`](https://github.com/jbrockmendel/pandas/blob/59f45511f0015e7bf390a22f269cce8fc5036ec0/pandas/core/tools/datetimes.py) !

 - In the file [`pandas/core/window.py`](https://github.com/jbrockmendel/pandas/blob/59f45511f0015e7bf390a22f269cce8fc5036ec0/pandas/core/window.py), following                are the PEP8 issues :
> [Line 101:17](https://github.com/jbrockmendel/pandas/blob/59f45511f0015e7bf390a22f269cce8fc5036ec0/pandas/core/window.py#L101): [W504](https://duckduckgo.com/?q=pep8%20W504) line break after binary operator
> [Line 104:17](https://github.com/jbrockmendel/pandas/blob/59f45511f0015e7bf390a22f269cce8fc5036ec0/pandas/core/window.py#L104): [W504](https://duckduckgo.com/?q=pep8%20W504) line break after binary operator


 - In the file [`pandas/io/common.py`](https://github.com/jbrockmendel/pandas/blob/59f45511f0015e7bf390a22f269cce8fc5036ec0/pandas/io/common.py), following                are the PEP8 issues :
> [Line 433:13](https://github.com/jbrockmendel/pandas/blob/59f45511f0015e7bf390a22f269cce8fc5036ec0/pandas/io/common.py#L433): [W504](https://duckduckgo.com/?q=pep8%20W504) line break after binary operator


 - There are no PEP8 issues in the file [`pandas/io/excel.py`](https://github.com/jbrockmendel/pandas/blob/59f45511f0015e7bf390a22f269cce8fc5036ec0/pandas/io/excel.py) !

 - There are no PEP8 issues in the file [`pandas/io/formats/style.py`](https://github.com/jbrockmendel/pandas/blob/59f45511f0015e7bf390a22f269cce8fc5036ec0/pandas/io/formats/style.py) !

 - In the file [`pandas/io/formats/terminal.py`](https://github.com/jbrockmendel/pandas/blob/59f45511f0015e7bf390a22f269cce8fc5036ec0/pandas/io/formats/terminal.py), following                are the PEP8 issues :
> [Line 43:13](https://github.com/jbrockmendel/pandas/blob/59f45511f0015e7bf390a22f269cce8fc5036ec0/pandas/io/formats/terminal.py#L43): [W504](https://duckduckgo.com/?q=pep8%20W504) line break after binary operator


 - There are no PEP8 issues in the file [`pandas/io/json/normalize.py`](https://github.com/jbrockmendel/pandas/blob/59f45511f0015e7bf390a22f269cce8fc5036ec0/pandas/io/json/normalize.py) !

 - In the file [`pandas/io/parsers.py`](https://github.com/jbrockmendel/pandas/blob/59f45511f0015e7bf390a22f269cce8fc5036ec0/pandas/io/parsers.py), following                are the PEP8 issues :
> [Line 3206:13](https://github.com/jbrockmendel/pandas/blob/59f45511f0015e7bf390a22f269cce8fc5036ec0/pandas/io/parsers.py#L3206): [W504](https://duckduckgo.com/?q=pep8%20W504) line break after binary operator


 - In the file [`pandas/io/pytables.py`](https://github.com/jbrockmendel/pandas/blob/59f45511f0015e7bf390a22f269cce8fc5036ec0/pandas/io/pytables.py), following                are the PEP8 issues :
> [Line 1807:21](https://github.com/jbrockmendel/pandas/blob/59f45511f0015e7bf390a22f269cce8fc5036ec0/pandas/io/pytables.py#L1807): [W504](https://duckduckgo.com/?q=pep8%20W504) line break after binary operator


 - In the file [`pandas/io/stata.py`](https://github.com/jbrockmendel/pandas/blob/59f45511f0015e7bf390a22f269cce8fc5036ec0/pandas/io/stata.py), following                are the PEP8 issues :
> [Line 445:23](https://github.com/jbrockmendel/pandas/blob/59f45511f0015e7bf390a22f269cce8fc5036ec0/pandas/io/stata.py#L445): [W504](https://duckduckgo.com/?q=pep8%20W504) line break after binary operator
> [Line 2072:25](https://github.com/jbrockmendel/pandas/blob/59f45511f0015e7bf390a22f269cce8fc5036ec0/pandas/io/stata.py#L2072): [W504](https://duckduckgo.com/?q=pep8%20W504) line break after binary operator


 - There are no PEP8 issues in the file [`pandas/plotting/__init__.py`](https://github.com/jbrockmendel/pandas/blob/59f45511f0015e7bf390a22f269cce8fc5036ec0/pandas/plotting/__init__.py) !



##### Comment last updated on October 10, 2018 at 14:25 Hours UTC
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/23073?src=pr&el=h1) Report
> Merging [#23073](https://codecov.io/gh/pandas-dev/pandas/pull/23073?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/362f2e2d8ca42418e65b9c4d20de2ff1bacdabb8?src=pr&el=desc) will **increase** coverage by `<.01%`.
> The diff coverage is `91.89%`.

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

```diff
@@            Coverage Diff             @@
##           master   #23073      +/-   ##
==========================================
+ Coverage   92.19%    92.2%   +<.01%     
==========================================
  Files         169      169              
  Lines       50911    50916       +5     
==========================================
+ Hits        46939    46945       +6     
+ Misses       3972     3971       -1
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.62% <89.18%> (ø)` | :arrow_up: |
| #single | `42.3% <8.1%> (-0.01%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/23073?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/io/formats/terminal.py](https://codecov.io/gh/pandas-dev/pandas/pull/23073/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2Zvcm1hdHMvdGVybWluYWwucHk=) | `21.25% <0%> (ø)` | :arrow_up: |
| [pandas/io/formats/style.py](https://codecov.io/gh/pandas-dev/pandas/pull/23073/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2Zvcm1hdHMvc3R5bGUucHk=) | `96.66% <0%> (+0.22%)` | :arrow_up: |
| [pandas/core/reshape/pivot.py](https://codecov.io/gh/pandas-dev/pandas/pull/23073/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvcmVzaGFwZS9waXZvdC5weQ==) | `96.55% <100%> (ø)` | :arrow_up: |
| [pandas/io/json/normalize.py](https://codecov.io/gh/pandas-dev/pandas/pull/23073/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2pzb24vbm9ybWFsaXplLnB5) | `96.87% <100%> (ø)` | :arrow_up: |
| [pandas/core/base.py](https://codecov.io/gh/pandas-dev/pandas/pull/23073/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYmFzZS5weQ==) | `97.61% <100%> (ø)` | :arrow_up: |
| [pandas/io/common.py](https://codecov.io/gh/pandas-dev/pandas/pull/23073/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2NvbW1vbi5weQ==) | `71.04% <100%> (ø)` | :arrow_up: |
| [pandas/core/groupby/ops.py](https://codecov.io/gh/pandas-dev/pandas/pull/23073/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZ3JvdXBieS9vcHMucHk=) | `96.79% <100%> (ø)` | :arrow_up: |
| [pandas/compat/numpy/\_\_init\_\_.py](https://codecov.io/gh/pandas-dev/pandas/pull/23073/diff?src=pr&el=tree#diff-cGFuZGFzL2NvbXBhdC9udW1weS9fX2luaXRfXy5weQ==) | `93.93% <100%> (ø)` | :arrow_up: |
| [pandas/core/groupby/groupby.py](https://codecov.io/gh/pandas-dev/pandas/pull/23073/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZ3JvdXBieS9ncm91cGJ5LnB5) | `96.48% <100%> (+0.01%)` | :arrow_up: |
| [pandas/core/generic.py](https://codecov.io/gh/pandas-dev/pandas/pull/23073/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZ2VuZXJpYy5weQ==) | `96.65% <100%> (ø)` | :arrow_up: |
| ... and [10 more](https://codecov.io/gh/pandas-dev/pandas/pull/23073/diff?src=pr&el=tree-more) | |

------

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

Nice change, but I think we expect `and`, `or`... after the line break, as we ignore `W503` in the linting, and not `W504`. I don't have a preference, but I guess that's how it's in the rest of the code based on the linting setup.
> as we ignore W503 in the linting, and not W504

OK, I was wondering why pep8speaks was complaining about those.  I'm used to seeing the warnings in the other direction.  Will update.
Just check the linting settings, you may want to look in more detail before changing.
this looks fine. Do we have a lint rule to flag the line-continuation? alt do it in lint.sh (this can be a followup).

@datapythonista you ok here? merge away.
I was checking again, and looks like indded our standard is to have the operator after the line break and not before. For example: https://github.com/pandas-dev/pandas/blob/master/pandas/core/series.py#L243

So, I think it makes sense to make the changes to this PR, unless we want to change the convention at this point, and change the others. I personally don't have a preference, and I don't know what's supposed to be the way to avoid both `W503` and `W504`. But I think it makes sense to ignore just one of them, and be consistent in what we do.

Those are the cases where we're ignoring `W503` right now:
```
./doc/make.py:103:30: W503 line break before binary operator
./doc/make.py:104:30: W503 line break before binary operator
./pandas/core/series.py:243:19: W503 line break before binary operator
./pandas/core/frame.py:420:15: W503 line break before binary operator
./pandas/core/generic.py:1257:17: W503 line break before binary operator
./pandas/core/generic.py:1269:17: W503 line break before binary operator
./pandas/core/strings.py:2115:32: W503 line break before binary operator
./pandas/core/strings.py:2119:33: W503 line break before binary operator
./pandas/core/arrays/integer.py:243:17: W503 line break before binary operator
./pandas/core/indexes/multi.py:837:21: W503 line break before binary operator
./pandas/core/indexes/base.py:3128:25: W503 line break before binary operator
./pandas/core/reshape/merge.py:972:21: W503 line break before binary operator
./pandas/core/reshape/merge.py:975:21: W503 line break before binary operator
./pandas/core/groupby/grouper.py:502:17: W503 line break before binary operator
./pandas/core/internals/blocks.py:2112:13: W503 line break before binary operator
./pandas/core/internals/blocks.py:2164:13: W503 line break before binary operator
./pandas/tests/indexes/datetimes/test_date_range.py:784:39: W503 line break before binary operator
./pandas/tests/extension/test_integer.py:31:13: W503 line break before binary operator
./pandas/tests/extension/test_integer.py:102:21: W503 line break before binary operator
./pandas/tests/extension/test_integer.py:103:21: W503 line break before binary operator
./pandas/tests/tseries/offsets/conftest.py:15:25: W503 line break before binary operator
./pandas/io/parsers.py:1717:12: W503 line break before binary operator
./pandas/io/sas/sas7bdat.py:307:17: W503 line break before binary operator
./pandas/io/formats/csvs.py:146:13: W503 line break before binary operator
./scripts/validate_docstrings.py:114:17: W503 line break before binary operator
./scripts/validate_docstrings.py:225:17: W503 line break before binary operator
./scripts/download_wheels.py:28:14: W503 line break before binary operator
```
@datapythonista hmm, that is not convention. though its possible we have both flavors of this as not checking before.
I didn't think this was our convention as much as what's suggested (though not enforced) by PEP8

https://www.python.org/dev/peps/pep-0008/#should-a-line-break-before-or-after-a-binary-operator
I don't think we're at all consistent about it.  My preference would certainly be to leave the before/after issue to a separate Issue/PR.  But I'm happy to defer to @datapythonista if you think there's a Right Way To Do It.
Sorry, I just saw that `flake8` does not validate `W504` (the operator before the line break). I was assuming it didn't happen anywhere in the code before this PR, that's why I suggested to change it here.

I think it would be a good practice to follow the PEP8 recommendation (@WillAyd link) at some point, but that's surely for a different PR (and we'll have to wait for a newer version of `flake8` that validates it, or use something else).

Happy to merge this, but I think it makes sense to wait for #23101, or `pep8speaks` may report invalid errors in new PRs .
Thanks @jbrockmendel, #23101 is merged, so the linting should complain about the binary operations now.