CLN: replace %s syntax with .format in core.tools, algorithms.py, base.py
State: closed

Progress towards #16130

- [X] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`

Replaced `%s` syntax with `.format` in core.tools, algorithms.py, base.py. Additionally, made some of the existing positional `.format` code more explicit.

Labels:
name: Internals
description: Related to non-user accessible pandas implementation
name: Clean

Comments:
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/17305?src=pr&el=h1) Report
> Merging [#17305](https://codecov.io/gh/pandas-dev/pandas/pull/17305?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/a4c4edeb2a7e5c84b5a82a9743a12a4b66e7bcf1?src=pr&el=desc) will **decrease** coverage by `0.04%`.
> The diff coverage is `58.82%`.

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

```diff
@@            Coverage Diff             @@
##           master   #17305      +/-   ##
==========================================
- Coverage   91.03%   90.98%   -0.05%     
==========================================
  Files         162      162              
  Lines       49569    49572       +3     
==========================================
- Hits        45124    45105      -19     
- Misses       4445     4467      +22
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `88.77% <58.82%> (-0.03%)` | :arrow_down: |
| #single | `40.24% <5.88%> (-0.07%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/17305?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/algorithms.py](https://codecov.io/gh/pandas-dev/pandas/pull/17305?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYWxnb3JpdGhtcy5weQ==) | `94.15% <0%> (ø)` | :arrow_up: |
| [pandas/core/tools/timedeltas.py](https://codecov.io/gh/pandas-dev/pandas/pull/17305?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvdG9vbHMvdGltZWRlbHRhcy5weQ==) | `98.33% <100%> (ø)` | :arrow_up: |
| [pandas/core/tools/datetimes.py](https://codecov.io/gh/pandas-dev/pandas/pull/17305?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvdG9vbHMvZGF0ZXRpbWVzLnB5) | `66.75% <42.85%> (-0.1%)` | :arrow_down: |
| [pandas/core/base.py](https://codecov.io/gh/pandas-dev/pandas/pull/17305?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYmFzZS5weQ==) | `96.02% <71.42%> (ø)` | :arrow_up: |
| [pandas/io/gbq.py](https://codecov.io/gh/pandas-dev/pandas/pull/17305?src=pr&el=tree#diff-cGFuZGFzL2lvL2dicS5weQ==) | `25% <0%> (-58.34%)` | :arrow_down: |
| [pandas/plotting/\_converter.py](https://codecov.io/gh/pandas-dev/pandas/pull/17305?src=pr&el=tree#diff-cGFuZGFzL3Bsb3R0aW5nL19jb252ZXJ0ZXIucHk=) | `63.23% <0%> (-1.82%)` | :arrow_down: |
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/17305?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `97.72% <0%> (-0.1%)` | :arrow_down: |

------

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

# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/17305?src=pr&el=h1) Report
> Merging [#17305](https://codecov.io/gh/pandas-dev/pandas/pull/17305?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/a4c4edeb2a7e5c84b5a82a9743a12a4b66e7bcf1?src=pr&el=desc) will **decrease** coverage by `0.04%`.
> The diff coverage is `58.82%`.

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

```diff
@@            Coverage Diff             @@
##           master   #17305      +/-   ##
==========================================
- Coverage   91.03%   90.98%   -0.05%     
==========================================
  Files         162      162              
  Lines       49569    49572       +3     
==========================================
- Hits        45124    45105      -19     
- Misses       4445     4467      +22
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `88.77% <58.82%> (-0.03%)` | :arrow_down: |
| #single | `40.24% <5.88%> (-0.07%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/17305?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/algorithms.py](https://codecov.io/gh/pandas-dev/pandas/pull/17305?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYWxnb3JpdGhtcy5weQ==) | `94.15% <0%> (ø)` | :arrow_up: |
| [pandas/core/tools/timedeltas.py](https://codecov.io/gh/pandas-dev/pandas/pull/17305?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvdG9vbHMvdGltZWRlbHRhcy5weQ==) | `98.33% <100%> (ø)` | :arrow_up: |
| [pandas/core/tools/datetimes.py](https://codecov.io/gh/pandas-dev/pandas/pull/17305?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvdG9vbHMvZGF0ZXRpbWVzLnB5) | `66.75% <42.85%> (-0.1%)` | :arrow_down: |
| [pandas/core/base.py](https://codecov.io/gh/pandas-dev/pandas/pull/17305?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYmFzZS5weQ==) | `96.02% <71.42%> (ø)` | :arrow_up: |
| [pandas/io/gbq.py](https://codecov.io/gh/pandas-dev/pandas/pull/17305?src=pr&el=tree#diff-cGFuZGFzL2lvL2dicS5weQ==) | `25% <0%> (-58.34%)` | :arrow_down: |
| [pandas/plotting/\_converter.py](https://codecov.io/gh/pandas-dev/pandas/pull/17305?src=pr&el=tree#diff-cGFuZGFzL3Bsb3R0aW5nL19jb252ZXJ0ZXIucHk=) | `63.23% <0%> (-1.82%)` | :arrow_down: |
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/17305?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `97.72% <0%> (-0.1%)` | :arrow_down: |

------

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

thanks!