29 ms·
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)
by kgwgk 6y ago
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)