🌐
Pandas
pandas.pydata.org › docs › reference › api › pandas.DataFrame.tail.html
pandas.DataFrame.tail — pandas 3.0.2 documentation
>>> df.tail() animal 4 monkey 5 parrot 6 shark 7 whale 8 zebra · Viewing the last n lines (three in this case) >>> df.tail(3) animal 6 shark 7 whale 8 zebra · For negative values of n · >>> df.tail(-3) animal 3 lion 4 monkey 5 parrot 6 shark 7 whale 8 zebra ·
🌐
W3Schools
w3schools.com › python › pandas › ref_df_tail.asp
Pandas DataFrame tail() Method
In this example we use a .csv file called data.csv · import pandas as pd df = pd.read_csv('data.csv') print(df.tail()) Try it Yourself »
🌐
Codecademy
codecademy.com › docs › python:pandas › dataframe › .tail()
Python:Pandas | DataFrame | .tail() | Codecademy
July 8, 2024 - In Pandas, .tail() is a method that returns the last n rows of a DataFrame. By default, it returns the last 5 rows, but the number of rows can be adjusted by passing an integer argument to the method.
🌐
PYnative
pynative.com › home › python › pandas › pandas dataframe head, tail, at, iat
Pandas DataFrame head, tail, at, iat
March 9, 2023 - DataFrame.tail(n=5)Code language: Python (python) Example · In the below Student DataFrame with columns like Name, Age, and Marks. If we apply DataFrame.tail() function, we can see that only the bottom five rows are displayed in the output. import pandas as pd student_dict = {'Name': ['Joe', 'Nat', 'Harry','Jack','Jose',"Jill","Rose"], 'Age': [20, 21, 19,17,18,19,17], 'Marks': [85.10, 77.80, 91.54,72,87.9,90,72]} # create DataFrame from dict student_df = pd.DataFrame(student_dict) # display the bottom 5 rows bottomRows = student_df.tail() print(bottomRows)Code language: Python (python) Run ·
🌐
TutorialsPoint
tutorialspoint.com › article › python-pandas-how-to-use-pandas-dataframe-tail-function
Python Pandas – How to use Pandas DataFrame tail( ) function
May 27, 2024 - The Pandas DataFrame tail() function returns the last n rows of a DataFrame. This is particularly useful when combined with filtering operations to examine the bottom portion of your filtered data.
🌐
w3resource
w3resource.com › pandas › dataframe › dataframe-tail.php
Pandas DataFrame: tail() function - w3resource
August 19, 2022 - Pandas DataFrame - tail() function: The tail() function is used to return the last n rows.
🌐
Educative
educative.io › answers › what-are-head-and-tail-functions-in-pandas
What are head and tail functions in pandas?
print(df.head(-2)) # Printing all except the last 2 rows · Run · The tail function in Python displays the last five rows of the dataframe by default. It takes in a single parameter: the number of rows.
🌐
w3resource
w3resource.com › pandas › series › series-tail.php
Pandas Series: tail() function - w3resource
Python-Pandas Code: import numpy as np import pandas as pd df = pd.DataFrame({'animal':['dog', 'bee', 'cat', 'lion', 'monkey', 'tiger', 'fox', 'wolf', 'zebra']}) df.tail() Output: animal 4 monkey 5 tiger 6 fox 7 wolf 8 zebra · Example - Viewing the last n lines (three in this case): Python-Pandas Code: import numpy as np import pandas as pd df = pd.DataFrame({'animal':['dog', 'bee', 'cat', 'lion', 'monkey', 'tiger', 'fox', 'wolf', 'zebra']}) df.tail(3) Output: animal 6 fox 7 wolf 8 zebra ·
🌐
Apache
spark.apache.org › docs › latest › api › python › reference › pyspark.pandas › api › pyspark.pandas.DataFrame.tail.html
pyspark.pandas.DataFrame.tail — PySpark 4.1.1 documentation
>>> df.tail() animal 4 monkey 5 parrot 6 shark 7 whale 8 zebra · Viewing the last n lines (three in this case) >>> df.tail(3) animal 6 shark 7 whale 8 zebra · For negative values of n · >>> df.tail(-3) animal 3 lion 4 monkey 5 parrot 6 shark 7 whale 8 zebra ·
Find elsewhere
🌐
Spark By {Examples}
sparkbyexamples.com › home › pandas › pandas dataframe tail() method
Pandas DataFrame tail() Method - Spark By {Examples}
December 6, 2024 - In Pandas, the tail() method is used to return the last n rows of a DataFrame. By default, it returns the last 5 rows, but you can specify a different
🌐
AlphaCodingSkills
alphacodingskills.com › pandas › notes › pandas-function-dataframe-tail.php
Pandas DataFrame - tail() function - AlphaCodingSkills
The Pandas DataFrame tail() function returns the last n rows of the dataframe. The syntax for using this function is given below. Syntax: DataFrame.tail(n)
🌐
Pandas
pandas.pydata.org › pandas-docs › version › 0.23.4 › generated › pandas.DataFrame.tail.html
pandas.DataFrame.tail — pandas 0.23.4 documentation
DataFrame.tail(n=5)[source]¶ · Return the last n rows. This function returns last n rows from the object based on position. It is useful for quickly verifying data, for example, after sorting or appending rows. See also · pandas.DataFrame.head · The first n rows of the caller object.
🌐
Pandas
pandas.pydata.org › pandas-docs › stable › reference › api › pandas.DataFrame.tail.html
pandas.DataFrame.tail — pandas 3.0.1 documentation
>>> df.tail() animal 4 monkey 5 parrot 6 shark 7 whale 8 zebra · Viewing the last n lines (three in this case) >>> df.tail(3) animal 6 shark 7 whale 8 zebra · For negative values of n · >>> df.tail(-3) animal 3 lion 4 monkey 5 parrot 6 shark 7 whale 8 zebra ·
🌐
GeeksforGeeks
geeksforgeeks.org › pandas › python-pandas-dataframe-series-tail-method
Pandas Dataframe/Series.tail() method - Python - GeeksforGeeks
July 26, 2025 - The tail() method allows us to quickly preview the last few rows of a DataFrame or Series. This method is useful for data exploration as it helps us to inspect the bottom of the dataset without printing everything.
🌐
Note.nkmk.me
note.nkmk.me › home › python › pandas
pandas: Get first/last n rows of DataFrame with head() and tail() | note.nkmk.me
January 25, 2024 - print(df.tail()) # col_0 col_1 # row_5 F 4 # row_6 G 3 # row_7 H 2 # row_8 I 1 # row_9 J 0
🌐
Pandas
pandas.pydata.org › pandas-docs › version › 2.1 › reference › api › pandas.DataFrame.tail.html
pandas.DataFrame.tail — pandas 2.1.4 documentation
>>> df.tail() animal 4 monkey 5 parrot 6 shark 7 whale 8 zebra · Viewing the last n lines (three in this case) >>> df.tail(3) animal 6 shark 7 whale 8 zebra · For negative values of n · >>> df.tail(-3) animal 3 lion 4 monkey 5 parrot 6 shark 7 whale 8 zebra ·
🌐
Apache
spark.apache.org › docs › latest › api › python › reference › pyspark.sql › api › pyspark.sql.DataFrame.tail.html
pyspark.sql.DataFrame.tail — PySpark 4.1.1 documentation
Running tail requires moving data into the application’s driver process, and doing so with a very large num can crash the driver process with OutOfMemoryError. New in version 3.0.0. Changed in version 3.4.0: Supports Spark Connect. Parameters · numint · Number of records to return. Will return this number of records or all records if the DataFrame contains less than this number of records. Returns · list · List of rows · Examples · >>> df = spark.createDataFrame( ...
🌐
Analytics Vidhya
analyticsvidhya.com › home › head () and tail () functions explained with examples and codes
Head () and Tail () Functions Explained with Examples and Codes
June 11, 2025 - # Creating a sample data frame ... R tail(df, n = 2) ... The head() function in pandas displays the top rows of a DataFrame, while the tail() function shows the bottom rows. Both functions are used to get a quick overview of the data’s structure ...