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

View File

@@ -688,7 +688,7 @@ class DMatrix(object):
"""Set info type property into DMatrix."""
# 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:
raise ValueError('Expecting meta-info to contain a single column')
data = data[data.columns[0]]