PyMVPA / PyMVPA

MultiVariate Pattern Analysis in Python
http://www.pymvpa.org
Other
312 stars 135 forks source link

Concatenation of two Dataset objects #523

Closed usmanayubsh closed 7 years ago

usmanayubsh commented 7 years ago

Hi all,

Thanks for the beautiful work that you have put into this wonderful library. My question is related to numpy.concatenate like concatenation of two Dataset objects. I was wondering what other ways are there to concatenate two such objects except the way of looping over all attributes of each of them and using numpy.concatenate to concatenate them into one?

I am running an event-related analysis study and I have fMRI 4D images from 4 different runs. I can add a volume label (or target) to each sample using onset-times as collected by relevant Psychopy data files and fit an hrf model to each of the runs. But what I want to do is, concatenate each of the Dataset objects into one, with relevant chunk labels (1 for 1st run, 2 for 2nd etc.) for each of the samples.

So, the question is, what other way can I use to concatenate two Dataset objects than to use numpy.concatenate on each of its attributes?.

Thanks,

yarikoptic commented 7 years ago

Datasets have hstack and vstack, see e.g. http://www.pymvpa.org/generated/mvpa2.base.dataset.vstack.html cheers

usmanayubsh commented 7 years ago

Thanks alot @yarikoptic, that's exactly what I was looking for.

Cheers.