janitor.convert_matlab_date

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

Convert Matlab’s serial date number into Python datetime format.

Implementation is also from StackOverflow.

This method mutates the original DataFrame.

Functional usage syntax:

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

Method chaining syntax:

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

  • column_name – A column name.

Returns

A pandas DataFrame with corrected dates.