dashi package
Subpackages
Submodules
dashi.constants module
dashi.utils module
Utils functions
- format_data(input_dataframe, *, date_column_name, date_format='%y/%m/%d', verbose=False, numerical_column_names=None, categorical_column_names=None)[source]
Function to transform dates into ‘Date’ Python format
- Parameters:
input_dataframe (pd.DataFrame) – Pandas dataframe object with at least one columns of dates.
date_column_name (str) – The name of the column containing the dates.
date_format (str) – Structure of date format. By default ‘%y/%m/%d’.
verbose (bool) – Whether to display additional information during the process. Defaults to False.
numerical_column_names (Optional[List[str]]) – A list containing all the numerical column names in the dataset. If this parameter is None, the variables types must be managed by the user.
categorical_column_names (Optional[List[str]]) – A list containing all the categorical column names in the dataset. If this parameter is None, the variables types must be managed by the user.
- Returns:
An object of class pd.DataFrame with the date column transformed into ‘Date’ Python format, the categorical variables into category type and the numerical variables into float type.
- Return type:
pd.DataFrame