mirror of
https://github.com/wassname/catalyst.git
synced 2026-06-27 17:47:56 +08:00
BUG: fix sanitize_df to min of int32
This commit is contained in:
committed by
lacabra
parent
437e5c5b80
commit
60e07c8a3c
@@ -88,5 +88,7 @@ def safely_reduce_dtype(ser): # pandas.Series or numpy.array
|
||||
new_itemsize = np.min_scalar_type(val).itemsize
|
||||
if mx < new_itemsize:
|
||||
mx = new_itemsize
|
||||
if orig_dtype == 'int':
|
||||
mx = max(mx, 4)
|
||||
new_dtype = orig_dtype + str(mx * 8)
|
||||
return ser.astype(new_dtype)
|
||||
|
||||
Reference in New Issue
Block a user