ydata-profiling icon indicating copy to clipboard operation
ydata-profiling copied to clipboard

Variable Types to Dataframe

Open the-whopper opened this issue 4 years ago • 3 comments

Proposed feature

It would be really useful to get a simple datafame containing the Variable name and the inferred variable type.

the-whopper avatar Mar 02 '21 10:03 the-whopper

Can we please work on this?

ankitrajixr avatar Mar 07 '21 20:03 ankitrajixr

Maybe we can learn from featuretools or other feature engineering package

yaosting avatar Mar 09 '21 07:03 yaosting

@the-whopper I'm thinking that this might be a faster solution instead of creating a new feature for it.

df = pd.DataFrame({
    'vartype_numeric': [1, 2, 3],
    'vartype_bool': [True, False, True],
    'vartype_datetime': pd.to_datetime(['2021-01-01', '2022-01-01', '2023-01-01']),
    'vartype_unsupported': pd.to_timedelta([1, 2, 3], unit='days'),
    'vartype_categorical': pd.Categorical([1, 2, 3])
})

report = ProfileReport(df)
summary_df= pd.DataFrame(report.get_description()['variables'])

summary_df image

luckyzero0 avatar Jun 25 '22 07:06 luckyzero0