1

I would like to normalise this value in the range of 0 to 100. I have these values in a pandas dataframe.

    Latitude    Longitude
    25.436596   -100.887300
    25.436596   -100.887700
    25.436493   -100.887421
    25.436570   -100.887344
    25.436596   -100.887321

I am able to normalize the data between -1 to 1 using

    df_norm1 = (df - df.mean()) / (df.max() - df.min())

Can I normalise the same data in the range of 0 to 100. Any help would be greatly appreciated.

sophros
  • 11,665
  • 7
  • 38
  • 61
user3447653
  • 3,386
  • 9
  • 50
  • 83

1 Answers1

4

Change it to:

100 * (df - df.min()) / (df.max() - df.min())

The (df - df.min()) / (df.max() - df.min()) part is min-max normalization where the new scale is [0, 1]. If you multiply that with 100, you get your desired range.

ayhan
  • 64,199
  • 17
  • 170
  • 189