"src/vscode:/vscode.git/clone" did not exist on "04ccb4e87ca9fbdff640811e2b9c0a250055bfc5"
Unverified Commit 3fe13727 authored by José Morales's avatar José Morales Committed by GitHub
Browse files

[python-package] replace np.find_common_type with np.result_type (#5999)

parent 170a9304
...@@ -699,7 +699,7 @@ def _data_from_pandas( ...@@ -699,7 +699,7 @@ def _data_from_pandas(
_check_for_bad_pandas_dtypes(data.dtypes) _check_for_bad_pandas_dtypes(data.dtypes)
df_dtypes = [dtype.type for dtype in data.dtypes] df_dtypes = [dtype.type for dtype in data.dtypes]
df_dtypes.append(np.float32) # so that the target dtype considers floats df_dtypes.append(np.float32) # so that the target dtype considers floats
target_dtype = np.find_common_type(df_dtypes, []) target_dtype = np.result_type(*df_dtypes)
try: try:
# most common case (no nullable dtypes) # most common case (no nullable dtypes)
data = data.to_numpy(dtype=target_dtype, copy=False) data = data.to_numpy(dtype=target_dtype, copy=False)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment