From 77ff4f6f7ab04d6e0e05da65931fbb7b62ceba77 Mon Sep 17 00:00:00 2001 From: Nikita Timakin Date: Wed, 12 Aug 2020 19:05:28 +0300 Subject: [PATCH] DataFrame to numpy conversion fixed (#264) --- generator/wrapper_gen.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/generator/wrapper_gen.py b/generator/wrapper_gen.py index cc1261ac77..999e8b8806 100755 --- a/generator/wrapper_gen.py +++ b/generator/wrapper_gen.py @@ -185,7 +185,11 @@ def my_procid(): def get_data(x): if isinstance(x, pdDataFrame): - x = x.to_numpy() + x_dtypes = x.dtypes.values + if np.all(x_dtypes == x_dtypes[0]): + x = x.to_numpy() + else: + x = [xi.to_numpy() for _, xi in x.items()] elif isinstance(x, mdDataFrame): x = x.to_numpy() elif isinstance(x, pdSeries):