There are various ways we can replace the outliers it depends on the type of data you have, suppose you have some data with one of the columns has values 1,2,3,6,3,2,4,987 Now if you see most of the values are very much close to each other but there is one value which is too large in this case we use standard scaler or min-max scaler to normalize it since for this column range is very high, you can also replace the outliers by applying a condition if value is greater than the mean value of the column then replace it by mean value but standard scaler recommend when your data size is very big,