"""Export an Arrow type to its C representation."""
"""Export an Arrow type to its C representation."""
# Obtain objects to export
# Obtain objects to export
ifisinstance(data,pa_Table):
ifisinstance(data,pa_Array):
export_objects=[data]
elifisinstance(data,pa_ChunkedArray):
export_objects=data.chunks
elifisinstance(data,pa_Table):
export_objects=data.to_batches()
export_objects=data.to_batches()
else:
else:
raiseValueError(f"data of type '{type(data)}' cannot be exported to Arrow")
raiseValueError(f"data of type '{type(data)}' cannot be exported to Arrow")
...
@@ -1620,7 +1631,7 @@ class Dataset:
...
@@ -1620,7 +1631,7 @@ class Dataset:
data : str, pathlib.Path, numpy array, pandas DataFrame, H2O DataTable's Frame, scipy.sparse, Sequence, list of Sequence, list of numpy array or pyarrow Table
data : str, pathlib.Path, numpy array, pandas DataFrame, H2O DataTable's Frame, scipy.sparse, Sequence, list of Sequence, list of numpy array or pyarrow Table
Data source of Dataset.
Data source of Dataset.
If str or pathlib.Path, it represents the path to a text file (CSV, TSV, or LibSVM) or a LightGBM Dataset binary file.
If str or pathlib.Path, it represents the path to a text file (CSV, TSV, or LibSVM) or a LightGBM Dataset binary file.
label : list, numpy 1-D array, pandas Series / one-column DataFrame or None, optional (default=None)
label : list, numpy 1-D array, pandas Series / one-column DataFrame, pyarrow Array, pyarrow ChunkedArray or None, optional (default=None)
Label of the data.
Label of the data.
reference : Dataset or None, optional (default=None)
reference : Dataset or None, optional (default=None)
If this is Dataset for validation, training data should be used as reference.
If this is Dataset for validation, training data should be used as reference.
...
@@ -2402,7 +2413,7 @@ class Dataset:
...
@@ -2402,7 +2413,7 @@ class Dataset:
data : str, pathlib.Path, numpy array, pandas DataFrame, H2O DataTable's Frame, scipy.sparse, Sequence, list of Sequence or list of numpy array
data : str, pathlib.Path, numpy array, pandas DataFrame, H2O DataTable's Frame, scipy.sparse, Sequence, list of Sequence or list of numpy array
Data source of Dataset.
Data source of Dataset.
If str or pathlib.Path, it represents the path to a text file (CSV, TSV, or LibSVM) or a LightGBM Dataset binary file.
If str or pathlib.Path, it represents the path to a text file (CSV, TSV, or LibSVM) or a LightGBM Dataset binary file.
label : list, numpy 1-D array, pandas Series / one-column DataFrame or None, optional (default=None)
label : list, numpy 1-D array, pandas Series / one-column DataFrame, pyarrow Array, pyarrow ChunkedArray or None, optional (default=None)
Label of the data.
Label of the data.
weight : list, numpy 1-D array, pandas Series or None, optional (default=None)
weight : list, numpy 1-D array, pandas Series or None, optional (default=None)
Weight for each instance. Weights should be non-negative.
Weight for each instance. Weights should be non-negative.