DataFrame.tail
- DataFrame.tail(n: int = 5) DataFrame [source]
Return the last n rows.
This function returns the last n rows for the object based on position. The row order is sorted by index field. It is useful for quickly testing if your object has the right type of data in it.
Parameters
- n: int, default 5
Number of rows to select.
Returns
- opensearch_py_ml.DataFrame:
opensearch_py_ml DataFrame filtered on last n rows sorted by index field
See Also
Examples
>>> from tests import OPENSEARCH_TEST_CLIENT
>>> df = oml.DataFrame(OPENSEARCH_TEST_CLIENT, 'flights', columns=['Origin', 'Dest']) >>> print(df.tail().to_string().strip()) Origin Dest 13054 Pisa International Airport Xi'an Xianyang International Airport 13055 Winnipeg / James Armstrong Richardson International Airport Zurich Airport 13056 Licenciado Benito Juarez International Airport Ukrainka Air Base 13057 Itami Airport Ministro Pistarini International Airport 13058 Adelaide International Airport Washington Dulles International Airport