Answers for "python - extract min and max values per each column name"

0

python - extract min and max values per each column name

# 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("}")
Posted by: Guest on January-11-2021

Code answers related to "python - extract min and max values per each column name"

Python Answers by Framework

Browse Popular Code Answers by Language