I am working with the quantities
module of python, and I want to concatenate two quantiy arrays. If I use numpy.concatenate()
, I loose the unit from quantities
. The quantities
package itself does not provide a .concatenate()
method for its arrays. How to avoid this?
Example:
import scipy as sp
import quantities as pq
a = [1,2,3]*pq.V
b = [4,5,6]*pq.V
sp.concatenate([a,b])
returns
array([1., 2., 3., 4., 5., 6.]) * dimensionless