I can imagine the hypothetical binary tilde being pretty for some kind of equivalence. This is definitely not enough to motivate me to actually want to add it. But I think this would read OK as equivalent:
numpy.allclose(arr1, arr2) arr1 ~ arr2 However, the problem is that there are lots of other ways of being equivalent other than having elements that are all close. In the examples shown by Oscar and Aaron, we might ask whether two collections are drawn from the same distribution. That a useful question. But would this tilde mean the t-test? Unpaired or paired? Welch's t-test. Or maybe it should be a Kolmogorov-Smirnov test. Or a Shapiro-Wilk test? Or Wilcoxon's signed-rank test? Maybe Mann-Whitney's U test? The R approach with a "formula" is just a quotation of the thing we might test later, by whatever method. But as I've said, we already have quotes. So code like this seems fine to me: formula = "arr1 ~ arr2" ks_test(formula) welch_t(formula) However, once I've written that, it seem to have little point not simply to pass in the collections themselves to the various "equivalence" functions. -- 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/ROMWHGGVNKBOT2TTUNEUCBDDMCX3ESWU/ Code of Conduct: http://python.org/psf/codeofconduct/