On Mon, Feb 4, 2019 at 7:14 AM Kirill Balunov firstname.lastname@example.org wrote:
len(v) # -> 12
v[len] # -> <Vector of [3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3]>
In this case you can apply any function, even custom_linked_list from my_inhouse_module.py.
I think I really like this idea. Maybe as an extra spelling but still allow .apply() to do the same thing. It feels reasonably intuitive to me. Not *identical to* indexing in NumPy and Pandas, but sort of in the same spirit as predicative or selection based indices.
What do other people on this thread think? Would you learn that easily? Could you teach it?
<Vector of ['Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']>
v[i[1:]] # some helper class `i`
<Vector of ['an', 'eb', 'ar', 'pr', 'ay', 'un', 'ul', 'ug', 'ep', 'ct', 'ov', 'ec']>
This feels more forced, unfortunately. Something short would be good, but not sure I like this. This is really just a short spelling of pandas.IndexSlice or numpy.s_ It came up in another thread some months ago, but there is another proposal to allow the obvious spelling `slice[start:stop:sep]` as a way of creating slices.
Actually, I guess that's all halfway for the above. We'd need to do this still:
That's way too noisy. I guess I just don't find the lowercase `i` to be iconic enough. I think with a better SHORT name, I'd like:
Maybe that's not the name?