In these articles, We will discuss how to import an excel file in a single Dataframe and sort the Date in a given column on. Suppose our Excel file looks like these:

sample_date.xlsx
To get the excel file used click here.
Approach :
- Import Pandas module
- Make DataFrame from Excel file
- sort the date column with DataFrame.sort_value() function
- Display the Final DataFrame
Step 1: Importing pandas module and making DataFrame form excel.
Python3
import pandas as pd
df = pd.read_excel( 'excel_work\sample_date.xlsx' )
print ( "Original DataFrame" )
df
|
Output :

Step 2: Sorting date with DataFrame.sort_value() function.
Python3
Final_result = df.sort_values( 'Joining Date' )
print ( " Sorted Date DataFrame" )
Final_result
|
Output :

Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape,
GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out -
check it out now!
Last Updated :
05 Sep, 2020
Like Article
Save Article