Hacker News new | past | comments | ask | show | jobs | submit login

Iterating over the rows much more intuitive to me, just like rows in a database. In their example dataframe each row is a year, and columns represent different information about that year. So, if I wanted to compare rain from oct-sep on a yearly basis, I would iterate over the years (rows) and then grab that column by name.



It's inconsistent though, as iterating over a dataframe like

    for c in df:
will return the column labels. I expect `len(obj)` to return the same as `len([i for i in obj])`.


Between dplyr, ifelse, and apply family functions, I don't think I've ever had to iterate over a data frame in R.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: