![]() ![]() df.iterrows() is the correct answer to this question, but "vectorize your ops" is the better one. * It's actually a little more complicated than "don't". In many cases, iterating manually over the rows is not needed. Iterating through pandas objects is generally slow. The documentation page on iteration has a huge red warning box that says: Iterrows and itertuples (both receiving many votes in answers to this question) should be used in very rare circumstances, such as generating row objects/nametuples for sequential processing, which is really the only thing these functions are useful for.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |