API: make `hide_columns` and `hide_index` have a consistent signature and function in `Styler`
State: closed

This closes #41158 (which is an alternative PR for similar functionality)

Currently `hide_index()` and `hide_columns(subset)` have similar signatures but **different** operations. One hides the index whilst showing the data-rows, and the other hides data-columns whilst showing the column-headers row.

### This PR

 - adds the `subset` keyword to give: `hide_index(subset=None)`.
 - sets the default to `hide_columns(subset=None)`.

When `subset` is None the function now operates to hide the entire index, or entire column headers row respectively.
When `subset` is not None it operates to selectively hide the given rows or columns respectively, keeping the index or column headers row.


We also add the `show` keyword to allow the method to operate inversely.


@jreback I think you will prefer this over the `hide_values` and `hide_headers` methods suggested in #41158 since this re-uses the existing methods with minimal changes but tries to align their consistency. It is also fully backwards compatible.


Labels:
name: Styler
description: conditional formatting using DataFrame.style
name: API - Consistency
description: Internal Consistency of API/Behavior

Comments:
ok i undestand what you are doing, but this is still a very confusing api. we want to support

- hide index values themselves
- hide column values themselves
- hide particular columns

can you show me what you would write for these?
> ok i undestand what you are doing, but this is still a very confusing api. we want to support
> 
> * hide index values themselves
> * hide column values themselves
> * hide particular columns
> 
> can you show me what you would write for these?

sure..

![Screen Shot 2021-05-03 at 18 53 22](https://user-images.githubusercontent.com/24256554/116906708-e7b1b680-ac40-11eb-94af-ae7fb9a69f86.png)

The mechanics seem to be in place to do this quite easily, it just needs steering on the best API implementation..
ok your example looks fine. I am confused by the `show` keyword then.
> ok your example looks fine. I am confused by the `show` keyword then.

I removed the `show` option. Can always add it back later or do it in a different way
this is good, thanks @attack68 as a followup can you make sure that these methods are in the api ref & also we have sufficient docs in the notebook (the doc-strings are great obviously), but generally give an update in the notebook (its not of course necessary to add everything, but major things like this are good).
@meeseeksdev backport 1.3.x
Something went wrong ... Please have  a look at my logs.
Hi @attack68. I'm working on issue #42674 and I found some doctests with expected results different from the real results (at least in my tests). See the examples below:

* ``hide_columns()`` (**styles.py**)
```
>>> midx = pd.MultiIndex.from_product([["x", "y"], ["a", "b", "c"]])
>>> df = pd.DataFrame(np.random.randn(6,6), index=midx, columns=midx)
>>> df.style.format("{:.1f}").hide_columns()
x   d    0.1    0.0    0.4    1.3    0.6   -1.4
    e    0.7    1.0    1.3    1.5   -0.0   -0.2
    f    1.4   -0.8    1.6   -0.2   -0.4   -0.3
y   d    0.4    1.0   -0.2   -0.8   -1.2    1.1
    e   -0.6    1.2    1.8    1.9    0.3    0.3
    f    0.8    0.5   -0.3    1.2    2.2   -0.8
```
As you can see below, the values `d`, `e`, and `f` don't appear in the result, because they were actually defined as `a`, `b`, and `c`.  We can also see that `x` and `y` are aligned with `b` (second and fifth lines) and not with `d` (first and third lines):
![image](https://user-images.githubusercontent.com/11354911/127202736-9d3c9155-7d86-4dd5-97b0-56f619fac166.png)

Is there any reason these results are divergent?

Obs.: There are some other doctests in the same method after the one mentioned above, which present the same problem.