pydata/pandas — pull request #971 by jseabold (2012-03-26 21:22:19+00:00)
Title: Add an attach method to DataFrame

This is a method that injects the columns of a DataFrame into the calling namespace. As far as I can tell it works, even if it is hackish. However, the nosetests do not like the trickery and throw errors and failures. But, if you do

nosetests test_frame.py --pdb --pdb-failure

You can indeed see that the tests will pass from inside the debugger. I'm not really sure why. Does anyone have any ideas?

Am I missing anything about injecting variables into the calling local variables of the calling frame? I'm sure this is bad form, but it's functionality I've missed in Python.

Am I safe in assuming that column names are valid python variable names? If not, I may need to use a name validator.