API: use argument-free lambdas for injecting DataFrames columns as variables?
With [a little bit of magic](https://github.com/shoyer/pandas-magic/blob/master/pandas_magic/__init__.py#L13-L33), we could make the following syntax work:

``` python
(df[lambda: sepal_length > 3]
 .groupby(lambda: pd.cut(sepal_width, 5))
 .apply(lambda: petal_width.mean()))
```

Syntax like `df[lambda: sepal_length > 3]` is an alternative to more verbose alternatives like the recently added `df[lambda x: x.sepal_length > 3]` (https://github.com/pydata/pandas/issues/11485). Here we use `lambda` essentially in place of a macro that would allow for delayed evaluation (which of course are not supported by Python syntax).

My proposal is to add support for such "thunks" to every pandas method that accepts a callable function that currently must take a single argument work on DataFrames.

Under the covers, this works by (1) copying the `globals()` dictionary at evaluation time and (2) injecting the current DataFrame into it. We would further ensure that this only works on lambda functions, by checking `f.func_name == '<lambda>'`.

The main gotcha is that [it isn't possible to dynamically override ~~local~~ non-global variables](http://stackoverflow.com/questions/8028708/dynamically-set-local-variable-in-python) without [some true dark magic](https://gist.github.com/njsmith/2347382#file-inject-py-L40). This means that code like the following is going to behave contrary to expectations:

``` python
def x_plus_one(df):
    x = 0
    # uses x = 0 instead of df.x
    return df.pipe(lambda: x + 1)

df = pd.DataFrame({'x': np.arange(100)})
result = x_plus_one(df)  # all 1s, not range(1, 101)
```

Is this so bad? Shadowing variables in an outer scope is already poor design, but this is a pretty serious departure from expectations.

The other danger is that this could mask bugs, e.g., if a user mistakenly types `df.pipe(lambda: x)` instead of `df.pipe(lambda x: x)`. This is an unavoidable danger of spelling two APIs with similar syntax.

On the plus side, this proposal is safer than @njsmith's "true dark magic" context manager (see above) for injecting DataFrame columns, because there's no possibility of variable assignment inside a `lambda`.

Would this be a good idea for pandas?
