-
Notifications
You must be signed in to change notification settings - Fork 491
Closed
Description
import numpy as np
from pint import UnitRegistry
ureg = UnitRegistry()
Q_ = ureg.Quantity
args = []
for k in range(0,17):
uwnd = Q_(np.ones((1,73,144)),'meter / second')
args.append(uwnd)
uwndTot = np.vstack(args)
print(uwndTot.shape)
for element in args:
print(type(element)I am using Pint and when I print the shape uwndTot I get
(17,73,144).
When I print the values of element it turns out to be
<class 'pint.quantity.build_quantity_class..Quantity'>
However if I iterate through uwndTot I get
for element in uwndTot:
print(type(element))I get
<class 'numpy.ndarray'>
I want to be able to use numpy's concatenate with Pint. Is that not possible ? I need the units of meters /second in the 3d dimensional array uwndTot. How do I do that ?
Metadata
Metadata
Assignees
Labels
No labels