(label)
| 359 | |
| 360 | |
| 361 | def _label_from_pandas(label): |
| 362 | if isinstance(label, DataFrame): |
| 363 | if len(label.columns) > 1: |
| 364 | raise ValueError('DataFrame for label cannot have multiple columns') |
| 365 | if _get_bad_pandas_dtypes(label.dtypes): |
| 366 | raise ValueError('DataFrame.dtypes for label must be int, float or bool') |
| 367 | label = np.ravel(label.values.astype(np.float32, copy=False)) |
| 368 | return label |
| 369 | |
| 370 | |
| 371 | def _dump_pandas_categorical(pandas_categorical, file_name=None): |
no test coverage detected