ENH: Crosstab support for setting the margins name #15972
State: closed

closes #15972


Labels:
name: Reshaping
description: Concat, Merge/Join, Stack/Unstack, Explode
name: API Design

Comments:
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/15973?src=pr&el=h1) Report
> Merging [#15973](https://codecov.io/gh/pandas-dev/pandas/pull/15973?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/fbbcc10948e5847f1aa5f20684c15cdfc516f91c?src=pr&el=desc) will **increase** coverage by `<.01%`.
> The diff coverage is `n/a`.

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

```diff
@@            Coverage Diff             @@
##           master   #15973      +/-   ##
==========================================
+ Coverage      91%   91.01%   +<.01%     
==========================================
  Files         145      145              
  Lines       49581    49581              
==========================================
+ Hits        45123    45124       +1     
+ Misses       4458     4457       -1
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `88.77% <ø> (ø)` | :arrow_up: |
| #single | `40.57% <ø> (ø)` | :arrow_up: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/15973?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/tools/pivot.py](https://codecov.io/gh/pandas-dev/pandas/pull/15973?src=pr&el=tree#diff-cGFuZGFzL3Rvb2xzL3Bpdm90LnB5) | `95.07% <ø> (ø)` | :arrow_up: |
| [pandas/core/common.py](https://codecov.io/gh/pandas-dev/pandas/pull/15973?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvY29tbW9uLnB5) | `91.03% <0%> (+0.34%)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/15973?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/15973?src=pr&el=footer). Last update [fbbcc10...f976fdd](https://codecov.io/gh/pandas-dev/pandas/pull/15973?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/15973?src=pr&el=h1) Report
> Merging [#15973](https://codecov.io/gh/pandas-dev/pandas/pull/15973?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/fbbcc10948e5847f1aa5f20684c15cdfc516f91c?src=pr&el=desc) will **increase** coverage by `<.01%`.
> The diff coverage is `n/a`.

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

```diff
@@            Coverage Diff             @@
##           master   #15973      +/-   ##
==========================================
+ Coverage      91%   91.01%   +<.01%     
==========================================
  Files         145      145              
  Lines       49581    49581              
==========================================
+ Hits        45123    45124       +1     
+ Misses       4458     4457       -1
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `88.77% <ø> (ø)` | :arrow_up: |
| #single | `40.57% <ø> (ø)` | :arrow_up: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/15973?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/tools/pivot.py](https://codecov.io/gh/pandas-dev/pandas/pull/15973?src=pr&el=tree#diff-cGFuZGFzL3Rvb2xzL3Bpdm90LnB5) | `95.07% <ø> (ø)` | :arrow_up: |
| [pandas/core/common.py](https://codecov.io/gh/pandas-dev/pandas/pull/15973?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvY29tbW9uLnB5) | `91.03% <0%> (+0.34%)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/15973?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/15973?src=pr&el=footer). Last update [fbbcc10...f976fdd](https://codecov.io/gh/pandas-dev/pandas/pull/15973?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
needs a rebase and tests
Looks like https://github.com/pandas-dev/pandas/pull/16489 fixed this in the meantime. Sorry @slide333333 , but thanks anyways for the PR.