-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Trouble making categorical variable --- TypeError: 'ClassRegistry' object is not callable #13
Comments
You have an object named
I'm not sure what the right thing to do here is. We could make builtins override things in the scope, but that gets a bit icky if it means that you can't use variables named "C" without jumping through hoops, and whenever we add a new builtin it would potentially break existing scripts. Maybe we should keep the current behaviour, but issue a warning whenever someone looks up a builtin name but gets something else, i.e. it gets shadowed? That would preserve the semantics of existing formulas when we change the set of builtins, but it would still encourage people to avoid such names when possible. Would you be interested in preparing a pull request implementing such a warning? It'd involve adding some code to
and then we'd add an argument to |
Thanks for the tip. It must be all the stuff that IPython Notebook imports automatically. I can try running it from the regular console. (Update: works just fine outside of IPython Notebook with pylab enabled. No namespace conflict.) I haven't written any namespace confusion avoidance before, so that should be a good exercise. Not sure when I'll get to it... |
For the record: the problem is that sympy defines a bunch of magic shorthands that clash with ours, and if you use See here: http://docs.sympy.org/0.7.2/gotchas.html#symbols (specifically "Lastly, it is recommended that you not use I, E, S, N, C, O, or Q for variable or symbol names..."). This is a bit of a mess, because of course we want people to be able to use sympy and patsy together. I suppose we could still rename |
In some ways, Patsy is like the Regex module. Regex patterns solved this problem by introducing an escape character. |
Not sure what's going on here.
Using
virtualenv
on a Mac. Python 2.7.3.Pygments==1.5
cloud==2.6.9
distribute==0.6.31
ipython==0.13.1
matplotlib==1.2.0
nose==1.2.1
numpy==1.6.2
pandas==0.10.0
patsy==0.1.0
python-dateutil==2.1
pytz==2012h
pyzmq==2.2.0.1
readline==6.2.4.1
scipy==0.11.0
six==1.2.0
statsmodels==0.5.0
sympy==0.7.2
tornado==2.4.1
wsgiref==0.1.2
The text was updated successfully, but these errors were encountered: