+1 on (lazy) Sequence views optimized for sequential reads and random access (which hide the dict implementation which varies across which platforms?)
I'm somewhat indifferent on the name:
# Sequence views names:
## method() -> Sequence
- orderedkeys(), orderedvalues(), ordereditems()
- okeys(), ovalues(), oitems()
- keys(), keysordered(), values(), valuesordered(), items(), itemsordered()
- What does this do with tab-completion?
# Get key, value, item by integer-location method names:
## method(start: int, stop: int, step: int) -> Any
- keys_iloc(), values_iloc(), items_iloc()
## __getitem__(slice_or_int: Union[slice, int]) -> Any
- keys[0], values.iloc[1:4:2], items.iloc[1:4, 2:3]
- keys_iloc[], values_iloc[], items_iloc[]
- keysiloc[], valuesiloc[], itemsiloc[]
- keys.iloc[], values.iloc[], items.iloc[]
- keypos(),
## method(index: int) -> Any:
- getkey(), getvalue(), getitem(
# Get integer-location of a key, of a value:
## method(value) -> int, method(value) ->
- index(value)
- this is compatible with list.index and str.index but incompatible with Series/Dataframe.index (which may or may not be irrelevant)
- orderedkeys.index(), orderedvalues.index()
- okeys.index(), ovalues.index()
- keys.ordered.index(), values.ordered.index()
- getkeypos(), getvaluepos()
- getkeyiloc(), getvalueiloc()
...
Thoughts:
- what did i miss?
- is there an opportunity to optimize performance of e.g getvaluepos() / values.ordered.index()?
- performance considerations between islice(dict_view) and Sequence.__getitem__?