eland.DataFrame.iterrows#

DataFrame.iterrows() Iterable[Tuple[Union[str, Tuple[str, ...]], Series]]#

Iterate over eland.DataFrame rows as (index, pandas.Series) pairs.

Yields#

index: index

The index of the row.

data: pandas Series

The data of the row as a pandas Series.

See Also#

eland.DataFrame.itertuples: Iterate over eland.DataFrame rows as namedtuples.

Examples#

>>> df = ed.DataFrame('http://localhost:9200', 'flights', columns=['AvgTicketPrice', 'Cancelled']).head()
>>> df
   AvgTicketPrice  Cancelled
0      841.265642      False
1      882.982662      False
2      190.636904      False
3      181.694216       True
4      730.041778      False

[5 rows x 2 columns]
>>> for index, row in df.iterrows():
...     print(row)
AvgTicketPrice    841.265642
Cancelled              False
Name: 0, dtype: object
AvgTicketPrice    882.982662
Cancelled              False
Name: 1, dtype: object
AvgTicketPrice    190.636904
Cancelled              False
Name: 2, dtype: object
AvgTicketPrice    181.694216
Cancelled               True
Name: 3, dtype: object
AvgTicketPrice    730.041778
Cancelled              False
Name: 4, dtype: object