BUG: Bug in loc raised ValueError when setting value via boolean list
State: closed

- [x] closes #20438
- [x] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry

Not quite sure if conversion to numpy array is necessary, but ``is_dtype_bool`` does not accept lists


Labels:
name: Indexing
description: Related to indexing on series/frames, not to indexes themselves

Comments:
cc @jreback Thanks very much, iloc actually was a different issue. 

The validation in 
https://github.com/pandas-dev/pandas/blob/b96665777c083516c9cdf21d25b7d9ccf70c81bd/pandas/core/indexers.py#L153:L157
did not allow boolean lists. We have two options to fix this for iloc. I converted a boolean list to an array in the indexing module, because I was not sure if this validation was done on purpose this way. Alternatively we could adjust the referenced validation to allow boolean lists too
cc @jbrockmendel 
does this have a perf impact?  IIRC is_bool_indexer isn't completely cheap
Ran indexing asvs. Seems a bit weird
```
before           after         ratio
     [50ae0bfc]       [b5dd4534]
     <master>         <20438>   
-         249±9ms          225±8ms     0.90  indexing.NumericSeriesIndexing.time_getitem_array(<class 'pandas.core.indexes.numeric.Float64Index'>, 'unique_monotonic_inc')
-        30.5±2ms       27.4±0.4ms     0.90  indexing.ChainIndexing.time_chained_indexing(None)
-         252±7ms          218±8ms     0.87  indexing.NumericSeriesIndexing.time_loc_array(<class 'pandas.core.indexes.numeric.Float64Index'>, 'unique_monotonic_inc')
-         255±7ms          215±5ms     0.84  indexing.NumericSeriesIndexing.time_getitem_list_like(<class 'pandas.core.indexes.numeric.Float64Index'>, 'unique_monotonic_inc')
-         181±3ms          144±2ms     0.80  indexing.NumericSeriesIndexing.time_loc_array(<class 'pandas.core.indexes.numeric.Float64Index'>, 'nonunique_monotonic_inc')
-         185±4ms          147±2ms     0.79  indexing.NumericSeriesIndexing.time_getitem_array(<class 'pandas.core.indexes.numeric.Float64Index'>, 'nonunique_monotonic_inc')
-         190±9ms          150±3ms     0.79  indexing.NumericSeriesIndexing.time_getitem_lists(<class 'pandas.core.indexes.numeric.Float64Index'>, 'nonunique_monotonic_inc')
-        43.1±1μs       26.1±0.9μs     0.60  indexing.NumericSeriesIndexing.time_getitem_scalar(<class 'pandas.core.indexes.numeric.Float64Index'>, 'nonunique_monotonic_inc')
-     1.86±0.04ms      1.11±0.04ms     0.60  indexing.NumericSeriesIndexing.time_getitem_list_like(<class 'pandas.core.indexes.numeric.Float64Index'>, 'nonunique_monotonic_inc')
-     1.70±0.05ms         953±30μs     0.56  indexing.NumericSeriesIndexing.time_loc_list_like(<class 'pandas.core.indexes.numeric.Float64Index'>, 'nonunique_monotonic_inc')
-         308±8μs          166±6μs     0.54  indexing.NumericSeriesIndexing.time_getitem_slice(<class 'pandas.core.indexes.numeric.Float64Index'>, 'nonunique_monotonic_inc')
-        296±10μs          159±4μs     0.54  indexing.NumericSeriesIndexing.time_loc_slice(<class 'pandas.core.indexes.numeric.Float64Index'>, 'nonunique_monotonic_inc')
-        86.8±3μs         44.3±1μs     0.51  indexing.NumericSeriesIndexing.time_loc_scalar(<class 'pandas.core.indexes.numeric.Float64Index'>, 'nonunique_monotonic_inc')

SOME BENCHMARKS HAVE CHANGED SIGNIFICANTLY.
PERFORMANCE INCREASED.
```
couple comments, needs rebase otherwise LGTM
This pull request is stale because it has been open for thirty days with no activity. Please update or respond to this comment if you're still interested in working on this.
ping @jbrockmendel ?
This pull request is stale because it has been open for thirty days with no activity. Please update or respond to this comment if you're still interested in working on this.
It looks like in master the test case raises in check_setitem_lengths.  would it make sense to patch at that point?
We could check for lists there too and count the True occurrences. Implemented it.
@phofl can you rebase (i am not sure when it was before), and ping on green.
@jreback greenish, we have same number of failures as on master
Thanks @phofl