But that behavior is specific to Jupyter and so it could
similarly provide auto-complete or syntax highlighting for usage
of `smf.ols(formula=...)`. Like PyCharm provides syntax
highlighting for strings used as the `pattern` argument for the
various functions of the `re` module. So if it's only for the sake
of auto-complete or syntax highlighting, this is on the IDE and
not on the language, in my opinion.
I get auto-complete on column names in Pandas when I'm in Jupyter. But yes, I agree with you.
On Mon, Feb 24, 2020, 11:43 AM Dominik Vilsmeier <firstname.lastname@example.org> wrote:
I don't see what's wrong with the status quo:
smf.ols(formula='Lottery ~ Literacy + Wealth + Region', data=df)
If I understand correctly you want to use instead:
smf.ols(formula=df.Lottery ~ df.Literacy + df.Wealth + df.Region)
Or since some people favor indexing over attribute access for column names:
smf.ols(formula=df['Lottery'] ~ df['Literacy'] + df['Wealth'] +
Both alternatives are much more verbose since you have to repeat the
`df` part or even worse the brackets for indexing. In any case you need
to type the column names that you would like to include and there's no
auto-complete on column names that would help you typing it. So I don't
see what's the benefit of the operator version.
In addition this requires Pandas to implement the modeling but there's
much more to Pandas than just modeling so perhaps that better remains a
On 24.02.20 01:27, Aaron Hall via Python-ideas wrote:
> I have no behavior for integers in mind. I would expect high-level libraries to want to implement behavior for it.
> - sympy
> - pandas, numpy, sklearn, statsmodels
> - other mathematically minded libraries (monadic bind or compose?)
> To do this we need a name. I like `__sim__`. Then we'll need `__rsim__` and `__isim__` for completeness. We need to make room for it in the grammar. Is it ok to give it the same priority of evaluation as `+` or `-`, or slightly higher?
> In the past we've made additions to the language when we've been parsing and evaluating strings. That's what we're currently doing in statsmodels right now because we lack the binary (in the sense of two-arguments) `~`.
> See: https://www.statsmodels.org/dev/example_formulas.html
> Python-ideas mailing list -- email@example.com
> To unsubscribe send an email to firstname.lastname@example.org
> Message archived at https://email@example.com/message/JWC4HJVTHQA532VIW62UXVPMOEVVR2IT/
> Code of Conduct: http://python.org/psf/codeofconduct/
Python-ideas mailing list -- firstname.lastname@example.org
To unsubscribe send an email to email@example.com
Message archived at https://firstname.lastname@example.org/message/VQOYS4E5DVLZITGKLREB3YGPU6NEUNHR/
Code of Conduct: http://python.org/psf/codeofconduct/