ENH: Styler builtins: `highlight_between`
State: closed

- [x] tests added / passed
- [x] Ensure all linting tests pass, see [here](https://pandas.pydata.org/pandas-docs/dev/development/contributing.html#code-standards) for how to run them
- [x] whatsnew entry

- [x] update docs for existing highlight functions for consistency
- [x] add a new `props` argument to existing highlight functions.



Will add tests if approved:
Could wrap both methods into one as well, but probably easier api if two? 

![Screen Shot 2021-02-15 at 17 54 23](https://user-images.githubusercontent.com/24256554/107974441-e44e4d80-6fb6-11eb-8ed0-aaadf0ba2aa2.png)

![Screen Shot 2021-02-15 at 18 20 34](https://user-images.githubusercontent.com/24256554/107976893-90456800-6fba-11eb-93be-4c8b40f8160d.png)


Labels:
name: Enhancement
name: Styler
description: conditional formatting using DataFrame.style

Comments:
I like this, *esp* the smile, have to have it.
cc @TomAugspurger 
This is greenish. `test_from_coo` failure unrelated.  Below are new docs screenshots:

![Screen Shot 2021-02-23 at 09 51 11](https://user-images.githubusercontent.com/24256554/108825856-d5255c00-75c3-11eb-9bc0-805af72f5380.png)
![Screen Shot 2021-02-23 at 09 53 25](https://user-images.githubusercontent.com/24256554/108825868-d787b600-75c3-11eb-8270-45e4ee94093a.png)

lgtm. cc @pandas-dev/pandas-core if anyone has a chance to look / comment on the api additions here.
also cc @pandas-dev/pandas-triage 
What's the reasoning behind the naming of parameters start, stop, q_low and
q_high? Behind q_low being exclusive and all others inclusive? Certainly
won't be easy for users to remember.

I know start,stop from integer ranges (as in the python built-in) where
stop indicates an exclusive bound.

Series.between has parameters left, right. Both are inclusive by default
but can be exclusive with a parameter setting. The names aren't great, but
they are there. "highlight_between" might also be a good name.

Alternatives include allowing lte or lt to be specified, and gt,gte
similarly.

Example of a possible unified syntax:
series.between(left="10%", right=500, inclusive="left"). Then apply this in
highlight_between. The reduced visibility of the quantile functionality
here might be less than ideal. You could instead have parameters
left_quantile, right_quantile in the between implementation, with either
left or left_quantile to be specified.

> What's the reasoning behind the naming of parameters start, stop, 

I looked around for similar named functions. For ranges, start and stop/end seemed pretty common arg inputs.

> q_low and q_high? Behind q_low being exclusive and all others inclusive? 

The exclusive/inclusiveness is derived from `qcut`, nothing I can do about that but document it. For quartiles the `q` input name also seems quite common, but a `q_start` and `q_stop` are alternatives? 

> The names aren't great, but they are there. "highlight_between" might also be a good name. 

Not a fan of `highlight_between`, it feels too detached from things like `date_range`, `range` np.arange` `RangeIndex` etc. 

> Alternatives include allowing lte or lt to be specified, and gt,gte similarly.

Yes this would be nice, but it added complexity to a reasonably lengthy PR: will include if enough support. 
This is quite unlike arrange, etc unless it is generating objects at equal
interval.

Qcut isn't magical. It seems to estimate the quantiles, then use them as
bin edges to cut. It doesn't even seem appropriate to use here, where
estimating the quantiles and then using `between` to mask would be just as
appropriate.

- [x] changed name to `highligh_between`
- [x] implemented `inclusive` as arg for boundary with options `True, False, 'right', 'left'`
- [x] added tests for all `ValueError` and the new boundary inclusive options.

@jnothman after some reflection the `range` does feel like it is an object generation, and `between` is more a conditional, so I have made the change (can easily revert one commit). To be honest what swung it was that I always preferred the `left`/`right` arguments over `start`/`stop` and `between` had these.

I think `highlight_quantile` should be a separate function since it has a slightly different signature and there only a few Styler builtin functions so if a user intends to use quantiles as input it should be easily recognisable to use this method. I plan to modify the method to:

- [ ] use `numpy.quantile` instead of `pandas.qcut`
- [ ] pass through the numpy `interpolation` arg for calculating the quantiles.
- [ ] leverage `highlight_between` code passing through the `inclusive` arg with the calculated quantile values for `left` and `right`
- [ ] maybe change args to `q_left` and `q_right` for some consistency but maintain the `q` for quantile hint.

Any further suggestions do let me know.
this is getting too big. can you cut out the non-controverisal, maybe highlite_null into a separate PR
> as indicated let's break these changes up (e.g. you added props here?0 let's try to make clear single purpose PRs. have limited time to review, if you keep changing it this will take forever.
> 
> so don't add scope, instead break out pieces to simpler / single purpose PRs.

@jreback sorry, underestimated the scope at start and then it slowly grew. Appreciate you have a lot to go through. I have split this into 3 PRs:  #40242, this one, and #40244 (wip)
can you merge master 
@jreback ping on merge and green
thanks @attack68 very nice.

can you make sure that the notebook is up to date after last few things merged.
> thanks @attack68 very nice.
> 
> can you make sure that the notebook is up to date after last few things merged.

yes I will do that in coming week.