[Python-ideas] Alternative to PEP 532: delayed evaluation of expressions

Stephan Hoyer shoyer at gmail.com
Thu Nov 10 21:08:36 EST 2016


On Sun, Nov 6, 2016 at 5:32 PM, Nathaniel Smith <njs at pobox.com> wrote:

> Filtering out a subset of rows from a data frame in pandas; 'height'
> and 'age' refer to columns in the data frame (equivalent to
> data_frame[data_frame["height"] > 100 and data_frame["age"] < 5], but
> more ergonomic and faster (!)):
>
>     data_frame.subset!(height > 100 and age < 5)
>
> (IIRC pandas has at least experimented with various weird lambda hacks
> for this kind of thing; not sure what the current status is.)
>

We abandoned the experiment because we couldn't make it work properly.
There's no way to inject local variables in the appropriate scope around
the lambda function:
https://github.com/pandas-dev/pandas/issues/13040
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20161110/e592b64e/attachment.html>


More information about the Python-ideas mailing list