News for hackers. Stuff that matters.
Re:Will R Work on Apple Silicon? by hyperbovine on Wednesday November 11, 2020 @12:28PM (#25060440)
R is a but of a horror show under the hood, I agree, but if you're just an end user doing data analysis, consider:

    flights.iloc[0:10, flights.columns.get_indexer(['year', 'month', 'day'])])
versus

    flights %>% select("year", "month", "day") %>% head(10)
I could go on...
Re:Will R Work on Apple Silicon? by kgwgk on Wednesday November 11, 2020 @01:25PM (#25061154)
You could have done

    flights[['year', 'month', 'day']].head(10)
which is not so different from standard R

    head(flights[c("year", "month", "day")], 10)
but it's true that the following may be nicer

    flights[1:10, c("year", "month", "day")]
(by the way using head(10) is not the same as indexing 1:10 if there are less than 10 rows)
Re:Will R Work on Apple Silicon? by totalperspectiv on Wednesday November 11, 2020 @12:55PM (#25060802)
I totally agree that it is a very efficient and powerful tool for ad-hoc data analysis. It's just not what I would view as a responsible choice for production / publication code.
Re:Will R Work on Apple Silicon? by superbatfish on Wednesday November 11, 2020 @02:36PM (#25062014)

    flights[["year", "month", "day"]].head(10)
Re:Will R Work on Apple Silicon? by empthought on Wednesday November 11, 2020 @11:56PM (#25066596)
It’s pretty sad that both are worse than

     SELECT year, month, day
       FROM flights
      LIMIT 10
Re:Will R Work on Apple Silicon? by Tarq0n on Thursday November 12, 2020 @08:16PM (#25077658)
SELECT before FROM isn't really a good thing.
Re:Will R Work on Apple Silicon? by _Wintermute on Wednesday November 11, 2020 @02:38PM (#25062030)
That's a very dishonest example. Yes, terribly written pandas code looks terrible.
Re:Will R Work on Apple Silicon? by nojito on Wednesday November 11, 2020 @06:13PM (#25064152)
flights[1:10, .(year, month, day)]

for the data.table fans

Which is arguably the superior way to handle tabular data in 2020.