Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
tianlh
LightGBM-DCU
Commits
3fe13727
Unverified
Commit
3fe13727
authored
Aug 04, 2023
by
José Morales
Committed by
GitHub
Aug 04, 2023
Browse files
[python-package] replace np.find_common_type with np.result_type (#5999)
parent
170a9304
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
python-package/lightgbm/basic.py
python-package/lightgbm/basic.py
+1
-1
No files found.
python-package/lightgbm/basic.py
View file @
3fe13727
...
...
@@ -699,7 +699,7 @@ def _data_from_pandas(
_check_for_bad_pandas_dtypes
(
data
.
dtypes
)
df_dtypes
=
[
dtype
.
type
for
dtype
in
data
.
dtypes
]
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
:
# most common case (no nullable dtypes)
data
=
data
.
to_numpy
(
dtype
=
target_dtype
,
copy
=
False
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment