October 2019
Beginner to intermediate
674 pages
16h 43m
English
The items() method provides a means of iteratively accessing each row in a series or DataFrame. It performs a lazy evaluation to store each value in a row, along with the index in the form of a tuple. The results of this lazy evaluation can be obtained through an iterative process such as a for loop. Let's apply the items method on the Wins column of the DataFrame:
for item in sample_df["Wins"].items():print(item)
The following is the output:

The iteritems() method behaves in a similar way to the items() method:
for item in sample_df["Wins"].iteritems():print(item)
Read now
Unlock full access