如何使用 pandas 分析识别 pandas 中的数字列和分类列。只需要 dtype 代码不需要 pandas 分析的分析代码
how to recognize columns numeric and categorical in pandas using pandas profiling . only need dtype code not Analysis code of pandas profiling
我只需要代码来识别在 pandas 分析(数字和分类)中完成的列的数据类型,您能否从 pandas 分析包代码中只为我提取该代码。
系列 = series.fillna(np.nan)
# get `infer_dtypes` (bool) from config
if config.infer_dtypes:
# Infer variable types
vtype = typeset.infer_type(series)
series = typeset.cast_to_inferred(series)
else:
# Detect variable types from pandas dataframe (df.dtypes).
# [new dtypes, changed using `astype` function are now considered]
vtype = typeset.detect_type(series)
根据Pandas Profiling documentation,变量的 dtype 是使用 Visions 库推断的
尝试使用此示例进行列类型识别:
from visions.functional import infer_type
from visions.typesets import CompleteSet
typeset = CompleteSet()
print(infer_type(df, typeset))
我只需要代码来识别在 pandas 分析(数字和分类)中完成的列的数据类型,您能否从 pandas 分析包代码中只为我提取该代码。
系列 = series.fillna(np.nan)
# get `infer_dtypes` (bool) from config
if config.infer_dtypes:
# Infer variable types
vtype = typeset.infer_type(series)
series = typeset.cast_to_inferred(series)
else:
# Detect variable types from pandas dataframe (df.dtypes).
# [new dtypes, changed using `astype` function are now considered]
vtype = typeset.detect_type(series)
根据Pandas Profiling documentation,变量的 dtype 是使用 Visions 库推断的 尝试使用此示例进行列类型识别:
from visions.functional import infer_type
from visions.typesets import CompleteSet
typeset = CompleteSet()
print(infer_type(df, typeset))