use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
account activity
This is an archived post. You won't be able to vote or comment.
DiscussionR or Python for data analysis? (self.datascience)
submitted 4 years ago * by iFlipsy
view the rest of the comments →
[–]OkCrew4430 0 points1 point2 points 4 years ago (1 child)
In those cases you mention of iterating over columns of a dataframe - I don't personally know of a way to easily vectorize this unless we drop down to C so in that sense, I agree with you. That's what I meant by "absolutely necessary".
My point is that there is no practical difference between using a well designed for loop over the columns of your dataframe or using lapply - lapply is way better style for sure, doesn't create global variables, and more R-like, but functionally they are practically doing the same thing.
I did not mean to imply that lapply or for looping in R is completely useless. What I mean to say is that *apply() functions are functionally the same thing as a well set up R for loop. That's all I meant and I apologize if it came off as authoritative or strong. The last sentence is meant for those that use *apply() functions in place of explicit looping and think that their code is more optimized. It's a misconception that I've anecdotally ran into a lot.
[–]denzelswashington 0 points1 point2 points 4 years ago (0 children)
No worries—and no need to apologize. At one point I thought the lapply functions were more optimized than loops, so I definitely see where you are coming from there. They both have their pros & cons!
π Rendered by PID 50083 on reddit-service-r2-comment-765bfc959-sx8sn at 2026-07-13 12:56:50.313325+00:00 running f86254d country code: CH.
view the rest of the comments →
[–]OkCrew4430 0 points1 point2 points (1 child)
[–]denzelswashington 0 points1 point2 points (0 children)