0

I am using minmax scaling to scale the 'age' column in my df. Replacing the scaled values to the original df rounds up one of the numbers. I reproduced the same scaled_df with the exact numbers I have in the remote server in my local server and I don't see the rounding issue in my local, but I see it in the remote so I can't fully reproduce my issue. I also checked the dtypes (float64) and the type (both df) and they match with how the remote python is outputted. so I am not sure what the issue is.

The only thing I can think of is that the python in the virtual has an option to round.

Below is the code that should have reproduced the issue in my local but doesn't. The last number "0.5000" rounds to "1.000" in remote but stays the same in my local python.

Any help is appreciated, thanks.

import pandas as pd
df_age = {'age': [1, 0.066667,0.00000,0.50000] }
df_age = pd.DataFrame(data=df_age)
df = {'r': ['t', 'e','s','tt'] ,'age':[62,34,32,47]}
df = pd.DataFrame(data=df)

for col in df_age:
    df[col] = df_age[col] 
hope288
  • 615
  • 10
  • 22

0 Answers0