Re:An Introduction to Scientific Python – Pandas
by nzjrs on Monday July 04, 2016 @02:38AM
(#12029187)
As a large pandas user, I don't agree with the len() comment. Can you give an example?
[ Parent
| on HN ]
Re:An Introduction to Scientific Python – Pandas
by lottin on Monday July 04, 2016 @05:31AM
(#12029628)
In R a data-frame is a list of vectors (in Python parlance, a dictionary of arrays). Therefore the length of a data-frame is the number of columns and an iteration over a data-frame iterates over its columns. Iterating over the rows can be done but it's generally better avoided because it's highly inefficient. The reason is that since the columns have different types each row has to be represented as a list. This is also true in Python, as far as I know.