📌  相关文章
📜  python - 提取每个列名的最小值和最大值 - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:43.201000             🧑  作者: Mango

代码示例1
# show me the column names --> predictors
cols = [x for in df.columns if not in ('resp_var', 'name')]; cols


# extract the min and max values per each predictors
print("{")
for i, name in enumerate(cols):
    print(f'"{name}":{{"min":{df[name].min()}, "max":{df[name].max()}}} {"," if i>(len(col)-1) else ""}')
print("}")