Support non-str column names

This commit is contained in:
sinhrks
2015-10-04 13:30:01 +09:00
parent 2859c190cd
commit dbcb4c8729
2 changed files with 16 additions and 1 deletions

View File

@@ -153,7 +153,7 @@ def _maybe_from_pandas(data, feature_names, feature_types):
raise ValueError('DataFrame.dtypes must be int, float or bool')
if feature_names is None:
feature_names = data.columns.tolist()
feature_names = data.columns.format()
if feature_types is None:
mapper = {'int64': 'int', 'float64': 'q', 'bool': 'i'}
feature_types = [mapper[dtype.name] for dtype in dtypes]