Show More
@@ -25,7 +25,6 b' import shutil' | |||||
25 | import re |
|
25 | import re | |
26 | import time |
|
26 | import time | |
27 | import textwrap |
|
27 | import textwrap | |
28 | import types |
|
|||
29 | from cStringIO import StringIO |
|
28 | from cStringIO import StringIO | |
30 | from getopt import getopt,GetoptError |
|
29 | from getopt import getopt,GetoptError | |
31 | from pprint import pformat |
|
30 | from pprint import pformat | |
@@ -834,7 +833,7 b' Currently the magic system has the following functions:\\n"""' | |||||
834 |
|
833 | |||
835 | - For {},[],(): their length. |
|
834 | - For {},[],(): their length. | |
836 |
|
835 | |||
837 |
- For numpy a |
|
836 | - For numpy arrays, a summary with shape, number of | |
838 | elements, typecode and size in memory. |
|
837 | elements, typecode and size in memory. | |
839 |
|
838 | |||
840 | - Everything else: a string representation, snipping their middle if |
|
839 | - Everything else: a string representation, snipping their middle if | |
@@ -867,7 +866,7 b' Currently the magic system has the following functions:\\n"""' | |||||
867 | # if we have variables, move on... |
|
866 | # if we have variables, move on... | |
868 |
|
867 | |||
869 | # for these types, show len() instead of data: |
|
868 | # for these types, show len() instead of data: | |
870 |
seq_types = [ |
|
869 | seq_types = ['dict', 'list', 'tuple'] | |
871 |
|
870 | |||
872 | # for numpy/Numeric arrays, display summary info |
|
871 | # for numpy/Numeric arrays, display summary info | |
873 | try: |
|
872 | try: | |
@@ -926,7 +925,7 b' Currently the magic system has the following functions:\\n"""' | |||||
926 | for vname,var,vtype in zip(varnames,varlist,typelist): |
|
925 | for vname,var,vtype in zip(varnames,varlist,typelist): | |
927 | print itpl(vformat), |
|
926 | print itpl(vformat), | |
928 | if vtype in seq_types: |
|
927 | if vtype in seq_types: | |
929 | print len(var) |
|
928 | print "n="+str(len(var)) | |
930 | elif vtype in [array_type,ndarray_type]: |
|
929 | elif vtype in [array_type,ndarray_type]: | |
931 | vshape = str(var.shape).replace(',','').replace(' ','x')[1:-1] |
|
930 | vshape = str(var.shape).replace(',','').replace(' ','x')[1:-1] | |
932 | if vtype==ndarray_type: |
|
931 | if vtype==ndarray_type: |
General Comments 0
You need to be logged in to leave comments.
Login now