janitor.convert_excel_date

janitor.convert_excel_date(df: pandas.core.frame.DataFrame, column_name: Hashable) → pandas.core.frame.DataFrame[source]

Convert Excel’s serial date format into Python datetime format.

This method mutates the original DataFrame.

Implementation is also from Stack Overflow.

Functional usage syntax:

df = convert_excel_date(df, column_name='date')

Method chaining syntax:

import pandas as pd
import janitor
df = pd.DataFrame(...).convert_excel_date('date')
Parameters
  • df – A pandas DataFrame.

  • column_name – A column name.

Returns

A pandas DataFrame with corrected dates.