Fix docstring formatting

This commit is contained in:
Jabin Kong 2021-09-08 00:40:19 +08:00 committed by GitHub
parent 315f94b201
commit 77f9a455e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1452,10 +1452,10 @@ class DataFrame(NDFrame):
Yields Yields
------ ------
index: index index: index
The index of the row. The index of the row.
data: pandas Series data: pandas Series
The data of the row as a pandas Series. The data of the row as a pandas Series.
See Also See Also
-------- --------
@ -1501,19 +1501,19 @@ class DataFrame(NDFrame):
""" """
Iterate over eland.DataFrame rows as namedtuples. Iterate over eland.DataFrame rows as namedtuples.
Args Parameters
---- ----------
index: bool, default True index: bool, default True
If True, return the index as the first element of the tuple. If True, return the index as the first element of the tuple.
name: str or None, default "Eland" name: str or None, default "Eland"
The name of the returned namedtuples or None to return regular tuples. The name of the returned namedtuples or None to return regular tuples.
Returns Returns
------- -------
iterator iterator
An object to iterate over namedtuples for each row in the An object to iterate over namedtuples for each row in the
DataFrame with the first field possibly being the index and DataFrame with the first field possibly being the index and
following fields being the column values. following fields being the column values.
See Also See Also
-------- --------
@ -1541,6 +1541,7 @@ class DataFrame(NDFrame):
Eland(Index='4', AvgTicketPrice=730.041778346198, Cancelled=False) Eland(Index='4', AvgTicketPrice=730.041778346198, Cancelled=False)
By setting the `index` parameter to False we can remove the index as the first element of the tuple: By setting the `index` parameter to False we can remove the index as the first element of the tuple:
>>> for row in df.itertuples(index=False): >>> for row in df.itertuples(index=False):
... print(row) ... print(row)
Eland(AvgTicketPrice=841.2656419677076, Cancelled=False) Eland(AvgTicketPrice=841.2656419677076, Cancelled=False)
@ -1550,6 +1551,7 @@ class DataFrame(NDFrame):
Eland(AvgTicketPrice=730.041778346198, Cancelled=False) Eland(AvgTicketPrice=730.041778346198, Cancelled=False)
With the `name` parameter set we set a custom name for the yielded namedtuples: With the `name` parameter set we set a custom name for the yielded namedtuples:
>>> for row in df.itertuples(name='Flight'): >>> for row in df.itertuples(name='Flight'):
... print(row) ... print(row)
Flight(Index='0', AvgTicketPrice=841.2656419677076, Cancelled=False) Flight(Index='0', AvgTicketPrice=841.2656419677076, Cancelled=False)