kathrinse / be_great

A novel approach for synthesizing tabular data using pretrained large language models
MIT License
276 stars 46 forks source link

Change np.float to np.float64 #44

Closed Tim-Saijun closed 9 months ago

Tim-Saijun commented 9 months ago

Use np.float64 to work with Numpy>1.20 Otherwise, the current version will get the following error:

File /opt/conda/lib/python3.10/site-packages/be_great/great.py:404, in GReaT.impute(self, df_miss, temperature, k, max_length, max_retries, device)
    400 for i_num_cols in self.num_cols:
    401     df_curr[i_num_cols] = pd.to_numeric(
    402         df_curr[i_num_cols], errors="coerce"
    403     )
--> 404 df_curr[self.num_cols] = df_curr[self.num_cols].astype(np.float)
    406 # Check for missing values
    407 nans = df_curr.isna()

AttributeError: module 'numpy' has no attribute 'float'.
`np.float` was a deprecated alias for the builtin `float`. To avoid this error in existing code, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:    https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations