4 ms·
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
by keypusher 10y ago
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.
- filmor 10y agoIt'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])`.
- sin7 10y agoBetween dplyr, ifelse, and apply family functions, I don't think I've ever had to iterate over a data frame in R.