find min and max of a python column code example
Example 1: find min and max from dataframe column
max_value = column.max()
Example 2: 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("}")