Fernando Perez
2003-03-20 17:22:28 UTC
I'm a python newbie, currently in the process of moving
parts of my work from Matlab to python + Numeric.
When using python interactively, I often need something
like the Matlab "whos" command.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
a 1x1 8 double array
b 2x3 48 double array
Grand total is 7 elements using 56 bytes
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
is there any way of doing something similar in python?
Would this work for you?parts of my work from Matlab to python + Numeric.
When using python interactively, I often need something
like the Matlab "whos" command.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
a = 4;
b = [1 2 3; 4 5 6];
whos
Name Size Bytes Classb = [1 2 3; 4 5 6];
whos
a 1x1 8 double array
b 2x3 48 double array
Grand total is 7 elements using 56 bytes
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
is there any way of doing something similar in python?
In [1]: a=4;
In [2]: b=array([[1,2,3],[4,5,6]]);
In [3]: whos
Variable Type Data/Length
------------------------------
a int 4
b array [[1 2 3]
[4 5 6]]
Take a look at http://ipython.scipy.org/
Cheers,
f