TIP: Setting dtypes inside the ADIX environment will NOT change the data types of the pandas dataframe. They are used internally for a more precise description of the variables.
Configs.get_dtypes
Configs.get_dtypes( dataframe )
This function gets suggested data types for each variable in the provided DataFrame.
Parameters:
- dataframe: pandas df
The DataFrame for which data types are to be determined.
Returns:
- dict:
A dictionary containing suggested data types for each variable. Keys are variable names, and values are the suggested data types.
Examples
#To get suggested data types for variables in the Titanic dataset:
>>> ix.Configs.get_dtypes(titanic)
...
{'PassengerId': 'continuous',
'Survived': 'categorical',
'Pclass': 'categorical',
'Name': 'text',
'Sex': 'categorical',
'Age': 'continuous',
'SibSp': 'categorical',
'Parch': 'categorical',
'Ticket': 'text',
'Fare': 'continuous',
'Cabin': 'text',
'Embarked': 'categorical'}