`[]` and `.loc[]`, `.iloc[]` and `.at[]`, `.iat[]` - should behave exactly like
their counter-parts from pd.DataFrame. They can take as indexer
...
...
@@ -69,185 +68,34 @@ fill np.nans at missing locations and therefore also fill-up, whole missing colu
Setting values with `[]` and `.loc[]`, `.iloc[]` and `.at[]`, `.iat[]` works like in pandas.
With `.at`/`.iat` only single items can be set, for the other the
right hand side values can be:
-*scalars*: these are broadcasted to the selected positions
-*nested lists*: the length of the outer list must match the number of indexed columns, the lengths of the inner lists must match the number of selected rows.
-*dios*: the length of the columns must match the number of indexed columns - columns does *not* align,
they are just iterated.
Rows do align. Rows that are present on the right but not on the left are ignored.
Rows that are present on the left (bear in mind: these rows was explicitly chosen for write!), but not present
on the right, are filled with `NaN`s, like in pandas.
-*normal lists* : column keys must be a scalar(!), the list is passed down, and set with `loc`, `iloc` or `[]` by pandas Series.
-*pd.Series*: column indexer must be a scalar(!), the series is passed down, and set with `loc`, `iloc` or `[]`
by pandas Series, where it maybe align, depending on the method.
Examples:
-*scalars*: these are broadcasted to the selected positions
-*nested lists*: the length of the outer list must match the number of indexed columns,
the lengths of the inner lists must match the number of selected rows.
-*dios*: the length of the columns must match the number of indexed columns - columns does *not* align,
they are just iterated.
Rows do align. Rows that are present on the right but not on the left are ignored.
Rows that are present on the left (bear in mind: these rows was explicitly chosen for write!), but not present
on the right, are filled with `NaN`s, like in pandas.
-*normal lists* : column keys must be a scalar(!), the list is passed down, and set with `loc`, `iloc` or `[]` by pandas Series.
-*pd.Series*: column indexer must be a scalar(!), the series is passed down, and set with `loc`, `iloc` or `[]`
by pandas Series, where it maybe align, depending on the method.
**Examples:**
-`dios.loc[2:5, 'a'] = [1,2,3]` is the same as `a=dios['a']; a.loc[2:5]=[1,2,3]; dios['a']=a`
-`dios.loc[2:5, :] = 99` : set 99 on rows 2 to 5 on all columns
**the special indexer `.aloc`**
The special indexer `.aloc`
-----------------------------
Additional to the pandas like indexers we have a `.aloc[..]` (align locator) indexing method.
Unlike `.iloc` and `.loc` indexers fully align if possible and 1D-array-likes can be broadcast
to multiple columns at once. This method also handle missing indexer-items gracefully.
It is used like `.loc`, so a single indexer (`.aloc[indexer]`) or a tuple of row-indexer and
column-indexer (`.aloc[row-indexer, column-indexer]`) can be given.
Unlike the other indexer methods, it is not possible to get a single item returned; the return type
is either a pandas Series, iff the column-indexer is a single key (eg. `'a'`) or a dios, iff not.
2D-indexer (like dios or df), only can passed as a single key, like `.aloc[2D-indexer]` or
with a ellipsis, as column indexer, like `.aloc[2D-indexer, ...]`. The behavior may differ between these
methods, as explained later below.
If a normal (non 2D-dimensional) row indexer is given, but no column indexer, the latter defaults to `:` aka.
`slice(None)`, so `.aloc[row-indexer]` becomes `.aloc[row-indexer, :]`, which means, that all columns are used.
In general, a normal row-indexer is applied to every column, that was chosen by the column indexer, but for
each column separately.
Example:
```
>> d
a | b | c | d |
===== | ===== | ===== | ===== |
0 66 | 2 77 | 0 88 | 1 99 |
1 66 | 3 77 | 1 88 | 2 99 |
>> d.aloc[[1,2], ['a', 'b', 'd']]
a | b | d |
===== | ===== | ===== |
1 66 | 2 77 | 1 99 |
| | 2 99 |
```
Following the `.aloc` specific indexer are listed. Any indexer that is not listed (slice, boolean lists, ...)
are treated similar, as they would passed to `.loc` (actually they are really passed to `'loc` under the hood).
*special **Column** indexer* are :
-*list / array-like* (or any iterable object): Only labels that are present in the columns are used, others are
ignored. A dios is returned.
-*pd.Series* : `.values` are taken from series and handled like a *list*. A dios is returned.
-*scalar* (or any hashable obj) : Select a single column, if label is present, otherwise nothing. [1]
*special **Row** indexer* are :
-*list / array-like* (or any iterable object): Only rows, which indices are present in the index of the column are
used, others are ignored. A dios is returned.
-*scalar* (or any hashable obj) : Select a single row from a column, if the value is present in the index of
the column, otherwise nothing is selected. [1]
-*pd.Series* : align the index from the given Series with the column, what means only common indices are used. The
actual values of the series are ignored(!).
-*boolean pd.Series* : like *pd.Series* but only True values are evaluated.
False values are equivalent to missing indices. To treat a boolean series as a *normal* indexer series, as decribed
above, one can use `.aloc(usebool=False)[boolean pd.Series]`.
*special **2D**-indexer* are :
-`.aloc[boolean dios-like]` : work same like `di[boolean dios-like]` (see there).
Brief: full align, select items, where the index is present and the value is True.
-`.aloc[dios-like, ...]` (with Ellipsis) : Align in columns and rows, ignore its values. Per common column,
the common indices are selected. The ellipsis forces `aloc`, to ignore the values, so a boolean dios could be
treated as a non-boolean. Alternatively `.aloc(usebool=False)[boolean dios-like]` could be used.[2]
-`.aloc[nested list-like]` : The inner lists are used as `aloc`-*list*-row-indexer (see there) on all columns.
One list for one column, which implies, that the outer list has the same length as the number of columns.
*special handling of 1D-**values***
Values that are list- or array-like, which includes pd.Series, are set on all selected columns. pd.Series align