| `.aloc[[True,False], any]` | bool list-like | rows |yes| take `True`'s | length must match nr of (all selected) columns | [blist](#boolean-array-likes-as-row-indexer)|
| `.aloc[bs, any]` | bool pandas.Series | rows |no | align + just take `True`'s | evaluate `usebool`-keyword | [ser](#pandasseries-and-boolean-pandasseries-as-row-indexer)|
| `.aloc[[[s],[1,2,3]], any]` | nested list-like | both | ? | one row-indexer per column | outer length must match nr of (selected) columns | [nlist](#nested-lists-as-row-indexer) |
|[2D-indexer](#the-power-of-2d-indexer)|
| `.aloc[di]` | dios-like | both |no | full align | - | |
| `.aloc[di, ...]` | dios-like | both |no | full align, ellipsis has no effect | - | |
| `.aloc[di>5]` | bool dios-like | both |no | full align + take `True`'s [1] | - | |
| `.aloc[di>5, ...]` | (bool) dios-like | both |no | full align, disable bool evaluation | - | |
[1] evaluate `usebool`-keyword
| `.aloc[di, ...]` | dios-like | both |no | full align | ellipsis has no effect | |
| `.aloc[di>5]` | bool dios-like | both |no | full align + take `True`'s | evaluate `usebool`-keyword | |
| `.aloc[di>5, ...]` | (bool) dios-like | both |no | full align, **no** bool evaluation | - | |
Example dios
============
...
...
@@ -130,7 +131,7 @@ The dios used in the examples, unless stated otherwise:
Select columns, gracefully
===========================
**single columns**
**Single columns**
Use `.aloc[:, key]` to select a single column gracefully.
The underling pandas Series is returned, if the key exist.
...
...
@@ -150,16 +151,12 @@ Series([], dtype: object)
```
**multiple columns**
**Multiple columns**
Just like selecting *single columns gracefully*, but with a array-like indexer.
A dios is returned, with a subset of the existing columns.
If no key is present a empty dios is returned.
If the key is a pandas.Series, its *values* are used for indexing, especially the Series's index is ignored.
To select all columns simply use `.aloc[:,:]` or even simpler `.aloc[:]`, just like one would do with `loc` or `iloc`.
```
>>> d.aloc[:, ['c', 99, None, 'a', 'x', 'y']]
a | c |
...
...
@@ -185,6 +182,24 @@ d.aloc[:, s]
4 28 | 8 47 | 10 4 |
```
**Boolean indexing, indexing with pd.Series and slice indexer**
**Boolean indexer**, for example `[True, 'False', 'True', 'False']`, must have the same length than the number
of columns, then only columns, where the indexer has a `True` value are selected.
If the key is a **pandas.Series**, its *values* are used for indexing, especially the Series's index is ignored. If a
series has boolean values its treated like a boolean indexer, otherwise its treated as a array-like indexer.
A easy way to select all columns, is, to use null-**slice**es, like `.aloc[:,:]` or even simpler `.aloc[:]`.
This is just like one would do, with `loc` or `iloc`. Of course slicing with boundaries also work,
eg `.loc[:, 'a':'f']`.
For more information about boolean or slice indexing see the pandas documentation