News for hackers. Stuff that matters.
Re:R adds native pipe and lambda syntax by RussianCow on Saturday December 05, 2020 @06:17PM (#25319387)
I'm not sure what specific "functions" you're talking about, but Python generally encourages a procedural style of programming as opposed to functional. The rationale is that functional code can be really difficult to read if you aren't already familiar with the idioms and terminology, whereas it's pretty easy to mentally parse and understand a `for` loop. So in that sense, list comprehensions are about as far as Python goes in that direction; there is no syntactic equivalent to the pipe operator, and no way to write reduce or similar operations as succinctly as you can in functional languages.
Re:R adds native pipe and lambda syntax by nightski on Saturday December 05, 2020 @09:19PM (#25320433)
Having read plenty of python numerical code, I'm not sure "easy to parse and understand" is what exactly comes to mind.
Re:R adds native pipe and lambda syntax by empthought on Sunday December 06, 2020 @10:38AM (#25324169)
Most of the problem comes from Pandas which is of course R-inspired.
Re:R adds native pipe and lambda syntax by disgruntledphd2 on Sunday December 06, 2020 @02:14PM (#25325824)
Yup, it's a terrible shame that pandas started off as a base-R clone in Python.

Now, the only time I write base-R like code is in Python, which is pretty weird.

It's also strange as sklearn is beautiful, and in general python libraries are nicer than the equivalents in R, but pandas is a large, warty exception.

Re:R adds native pipe and lambda syntax by vizzier on Saturday December 05, 2020 @06:30PM (#25319441)
And just in brief as to what the pipe generally does without the syntax available. If you have functions x and y which take 1 argument. Where |> is the piping syntax

y(1) |> x would be equivalent to x(y(1)) in python.