Show More
@@ -861,7 +861,7 b' Currently the magic system has the following functions:\\n"""' | |||||
861 | # for these types, show len() instead of data: |
|
861 | # for these types, show len() instead of data: | |
862 | seq_types = ['dict', 'list', 'tuple'] |
|
862 | seq_types = ['dict', 'list', 'tuple'] | |
863 |
|
863 | |||
864 |
# for numpy |
|
864 | # for numpy arrays, display summary info | |
865 | ndarray_type = None |
|
865 | ndarray_type = None | |
866 | if 'numpy' in sys.modules: |
|
866 | if 'numpy' in sys.modules: | |
867 | try: |
|
867 | try: | |
@@ -871,15 +871,6 b' Currently the magic system has the following functions:\\n"""' | |||||
871 | else: |
|
871 | else: | |
872 | ndarray_type = ndarray.__name__ |
|
872 | ndarray_type = ndarray.__name__ | |
873 |
|
873 | |||
874 | array_type = None |
|
|||
875 | if 'Numeric' in sys.modules: |
|
|||
876 | try: |
|
|||
877 | from Numeric import ArrayType |
|
|||
878 | except ImportError: |
|
|||
879 | pass |
|
|||
880 | else: |
|
|||
881 | array_type = ArrayType.__name__ |
|
|||
882 |
|
||||
883 | # Find all variable names and types so we can figure out column sizes |
|
874 | # Find all variable names and types so we can figure out column sizes | |
884 | def get_vars(i): |
|
875 | def get_vars(i): | |
885 | return self.shell.user_ns[i] |
|
876 | return self.shell.user_ns[i] | |
@@ -923,7 +914,7 b' Currently the magic system has the following functions:\\n"""' | |||||
923 | print vformat.format(vname, vtype, varwidth=varwidth, typewidth=typewidth), |
|
914 | print vformat.format(vname, vtype, varwidth=varwidth, typewidth=typewidth), | |
924 | if vtype in seq_types: |
|
915 | if vtype in seq_types: | |
925 | print "n="+str(len(var)) |
|
916 | print "n="+str(len(var)) | |
926 |
elif vtype |
|
917 | elif vtype == ndarray_type: | |
927 | vshape = str(var.shape).replace(',','').replace(' ','x')[1:-1] |
|
918 | vshape = str(var.shape).replace(',','').replace(' ','x')[1:-1] | |
928 | if vtype==ndarray_type: |
|
919 | if vtype==ndarray_type: | |
929 | # numpy |
|
920 | # numpy |
General Comments 0
You need to be logged in to leave comments.
Login now