Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

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("}")   
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #extract #min #max #values #column
ADD COMMENT
Topic
Name
6+2 =