eland.DataFrame.iterrows#
- DataFrame.iterrows() Iterable[Tuple[Union[str, Tuple[str, ...]], Series]] #
以 (索引, pandas.Series) 对的形式迭代 eland.DataFrame 行。
产量#
- 索引: 索引
行的索引。
- 数据: pandas Series
作为 pandas Series 的行数据。
参见#
eland.DataFrame.itertuples: 以 namedtuple 的形式迭代 eland.DataFrame 行。
示例#
>>> 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