Pandas documentation for df.items()
says;
Iterate over (column name, Series) pairs.
The exact same definition can be found for df.iteritems()
as well. Both seem to be doing the same thing.
However, I was curious whether there is any difference between these two, as there is between dict.items()
and dict.iteritems()
according to this SO question. Apparently, dict.items()
created a real list of tuples (in python2) potentially taking a lot of memory while dict.iteritems()
returns a generator.
Is this the case with df.items()
and df.iteritems()
? Is df.iteritems()
faster for dataframes having a large number of columns?