You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
>>>intTo.shape
(384, 320)
>>>intTo_expanded=intTo[mv.newaxis]
Traceback (mostrecentcalllast):
File"<stdin>", line1, in<module>File"/usr/local/uvcdat/2.4.0rc1/lib/python2.7/site-packages/cdms2/avariable.py", line1401, in__getitem__speclist=self._process_specs(key, {})
File"/usr/local/uvcdat/2.4.0rc1/lib/python2.7/site-packages/cdms2/avariable.py", line1169, in_process_specsraiseCDMSError, 'Sorry, you cannot use NewAxis in this context '+str(specs)
cdms2.error.CDMSError: Sorry, youcannotuseNewAxisinthiscontext (None, slice(None, None, None))
It's likely that the plans @dnadeau4 has for cdms2 updates (better wrapping all the existing numpy functions) will solve this, but thought it useful to document.
The text was updated successfully, but these errors were encountered:
The
numpy.newaxis
function should add a new (singleton) axis to an existing variable as per the docs:But it doesn't seem to work for
cdms2/MV2
:It's likely that the plans @dnadeau4 has for
cdms2
updates (better wrapping all the existingnumpy
functions) will solve this, but thought it useful to document.The text was updated successfully, but these errors were encountered: