##// END OF EJS Templates
Merge pull request #910 from minrk/pypynumpy...
Min RK -
r5198:4c90e861 merge
parent child Browse files
Show More
@@ -861,19 +861,15 b' Currently the magic system has the following functions:\\n"""'
861 861 # for these types, show len() instead of data:
862 862 seq_types = ['dict', 'list', 'tuple']
863 863
864 # for numpy/Numeric arrays, display summary info
865 try:
866 import numpy
867 except ImportError:
864 # for numpy arrays, display summary info
868 865 ndarray_type = None
869 else:
870 ndarray_type = numpy.ndarray.__name__
866 if 'numpy' in sys.modules:
871 867 try:
872 import Numeric
868 from numpy import ndarray
873 869 except ImportError:
874 array_type = None
870 pass
875 871 else:
876 array_type = Numeric.ArrayType.__name__
872 ndarray_type = ndarray.__name__
877 873
878 874 # Find all variable names and types so we can figure out column sizes
879 875 def get_vars(i):
@@ -918,7 +914,7 b' Currently the magic system has the following functions:\\n"""'
918 914 print vformat.format(vname, vtype, varwidth=varwidth, typewidth=typewidth),
919 915 if vtype in seq_types:
920 916 print "n="+str(len(var))
921 elif vtype in [array_type,ndarray_type]:
917 elif vtype == ndarray_type:
922 918 vshape = str(var.shape).replace(',','').replace(' ','x')[1:-1]
923 919 if vtype==ndarray_type:
924 920 # numpy
General Comments 0
You need to be logged in to leave comments. Login now