Ask Your Question

Revision history [back]

The method to adjust dataframe values to range between 0 and 1 is called min-max normalization or feature scaling.

It can be done using the following formula:

normalized_df = (df - df.min()) / (df.max() - df.min())

This formula subtracts the minimum value of the column from each value in the column and then divides the result by the range of the column (which is the difference between the maximum and minimum value). This rescales the values between 0 and 1.