bigframes.pandas.DataFrame.itertuples#

DataFrame.itertuples(index: bool = True, name: str | None = 'Pandas') Iterable[tuple[Any, ...]][source]#

Iterate over DataFrame rows as namedtuples.

Examples:

>>> df = bpd.DataFrame({
...     'A': [1, 2, 3],
...     'B': [4, 5, 6],
...     })
>>> next(df.itertuples(name="Pair"))
Pair(Index=np.int64(0), A=np.int64(1), B=np.int64(4))
Parameters:
  • index (bool, default True) – If True, return the index as the first element of the tuple.

  • name (str or None, default "Pandas") – The name of the returned namedtuples or None to return regular tuples.

Returns:

An object to iterate over namedtuples for each row in the DataFrame with the first field possibly being the index and following fields being the column values.

Return type:

Iterable[Tuple]