My understanding is as follows:
1.
2.
I really don't wanna go into details there - it's really very low level and as the comment at the beginning state
1.
patsy
parse the formula string (or Formula object).2.
patsy
lookup the execution environment to find any names that have been bound to objects in the execution environment from 1. The code for this is in https://github.com/pydata/patsy/blob/mas...sy/eval.py Maybe there are other parts too (e.g. here, where it use EvalEnvironment
class which will be used to look up any variables referenced in termlists
that cannot be found in data_iter_maker
- e.g. your case of Y
which is name not found in the dataframe passed as data
argument), but this looks like the main part of the code that deals with the matter.I really don't wanna go into details there - it's really very low level and as the comment at the beginning state
Quote:# Utilities that require an over-intimate knowledge of Python's execution environment.
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs