KamitaniLab / bdpy

Python package for brain decoding analysis (BrainDecoderToolbox2 data format, machine learning analysis, functional MRI)
MIT License
33 stars 22 forks source link

vstack fails with numpy arrays for labels #55

Open mabdelhack opened 1 year ago

mabdelhack commented 1 year ago

bdata/utils.py -> vstack function fails when the label data is numpy format.

Particularly the line [53] v += suc_cols[s] attempts to add the values instead of concatenating them vertically while the select line before it loads the data as unicode so it ends up throwing an error

UFuncTypeError: ufunc 'add' did not contain a loop with signature matching types (dtype('<U32'), dtype('<U32')) -> dtype('<U32')

Maybe using numpy vstack instead of list concatenation would be better?