Mercurial > hg > chourdakisreiss2016
annotate experiment-reverb/code/reshape_observations.py @ 0:246d5546657c
initial commit, needs cleanup
author | Emmanouil Theofanis Chourdakis <e.t.chourdakis@qmul.ac.uk> |
---|---|
date | Wed, 14 Dec 2016 13:15:48 +0000 |
parents | |
children |
rev | line source |
---|---|
e@0 | 1 from numpy import array, zeros |
e@0 | 2 |
e@0 | 3 def reshape_observations(L): |
e@0 | 4 |
e@0 | 5 rows = L[0].shape[0] |
e@0 | 6 columns = L[0].shape[1]*len(L) |
e@0 | 7 columns_one = L[0].shape[1] |
e@0 | 8 |
e@0 | 9 newarray = zeros((rows, columns)) |
e@0 | 10 |
e@0 | 11 for i in range(0, len(L)): |
e@0 | 12 newarray[:,i*columns_one:(i+1)*columns_one] = L[i] |
e@0 | 13 |
e@0 | 14 return newarray |
e@0 | 15 |