I am no expert on R, but R lazily evaluates arguments to functions; see https://cran.r-project.org/doc/manuals/r-devel/R-lang.html#Argument-evaluation (plus the rest of that page, which is the language spec). Tilde is strictly used for modeling. Also relevant would be the operator precedence https://cran.r-project.org/doc/manuals/r-devel/R-lang.html#Infix-and-prefix-operators - note that ~ has low precedence, which makes sense in how it is used.
We have a very straightforward way of lazily evaluating these formulas in Python, not to mention get the correct precedence - encapsulate as a string and use something like Patsy to parse! On Mon, Feb 24, 2020 at 11:59 AM David Mertz <me...@gnosis.cx> wrote: > Well... also, the meaning in R is quite a bit different from any of the > meanings suggested by Wolfram. In fact, although the most common use in R > is "depends on", it's technically just a generic delayed evaluation without > any inherent semantics at all. Or, that is to say, tilde is just a certain > kind of quotation, and we already have quotation in Python. > > On Mon, Feb 24, 2020 at 1:28 PM <jdve...@gmail.com> wrote: > >> Aaron Hall wrote: >> > The context for this is statistics , so I'll quote Wolfram on tilde in >> the context of >> > statistics: http://mathworld.wolfram.com/Tilde.html >> > "In statistics, the tilde is frequently used to mean "has the >> distribution (of)," for >> > instance, X∼N(0,1) means "the stochastic (random) variable X has the >> distribution N(0,1) >> > (the standard normal distribution). If X and Y are stochastic variables >> then X∼Y means "X >> > has the same distribution as Y." >> >> I think that you have refuted your own idea. You have argued that ~ is >> rightful statistical operator. But Python is not an statistical language. >> Python is a general purpose programming language while R is a statistical >> one. They have different domains so what is useful and right in R it is not >> necessary useful and right in Python. I cannot see a case for a statistical >> operator in Python. >> _______________________________________________ >> Python-ideas mailing list -- python-ideas@python.org >> To unsubscribe send an email to python-ideas-le...@python.org >> https://mail.python.org/mailman3/lists/python-ideas.python.org/ >> Message archived at >> https://mail.python.org/archives/list/python-ideas@python.org/message/IZMGSVIEHWDASTLUDP5AXLQKMZ4BPDGR/ >> Code of Conduct: http://python.org/psf/codeofconduct/ >> > > > -- > Keeping medicines from the bloodstreams of the sick; food > from the bellies of the hungry; books from the hands of the > uneducated; technology from the underdeveloped; and putting > advocates of freedom in prisons. Intellectual property is > to the 21st century what the slave trade was to the 16th. > _______________________________________________ > Python-ideas mailing list -- python-ideas@python.org > To unsubscribe send an email to python-ideas-le...@python.org > https://mail.python.org/mailman3/lists/python-ideas.python.org/ > Message archived at > https://mail.python.org/archives/list/python-ideas@python.org/message/6DQC4AOHMVL6RLMLAA3GT3LMJROUULQ5/ > Code of Conduct: http://python.org/psf/codeofconduct/ >
_______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/3G7YVHALBLA6RCNMM2AB3NI5S37Z6BZJ/ Code of Conduct: http://python.org/psf/codeofconduct/