Fix cupy without cudf import (#5219)

This commit is contained in:
Rory Mitchell 2020-01-22 18:02:39 +13:00 committed by GitHub
parent 9c56480c61
commit 5d4c24a1fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -688,7 +688,7 @@ class DMatrix(object):
"""Set info type property into DMatrix.""" """Set info type property into DMatrix."""
# If we are passed a dataframe, extract the series # If we are passed a dataframe, extract the series
if isinstance(data, CUDF_DataFrame): if CUDF_INSTALLED and isinstance(data, CUDF_DataFrame):
if len(data.columns) != 1: if len(data.columns) != 1:
raise ValueError('Expecting meta-info to contain a single column') raise ValueError('Expecting meta-info to contain a single column')
data = data[data.columns[0]] data = data[data.columns[0]]