[AstroPy] Short survey on behavior of multi-dimensional arrays

Paul Barrett Barrett at stsci.edu
Fri Mar 2 08:51:40 CST 2001


This is a short survey on some behavioral aspects of multi-dimensional
arrays.  Please take the time to complete this survey and send your
results back to me: Paul Barrett <barrett at stsci.edu>.  Please don't
hesitate to contact me if you need clarification on one or more
questions or have questions of your own that you would like answered.

Cheers,
Paul

------------------------------------------------------------------------

                             Questionaire

Q1. Given the following Python code:

    >>> A = array([11, 12, 13])
    >>> B = A[:]
    >>> A[0] = 1

    What is B[0] and why?


Q2. Given the following Python code:

    >>> A = array([[11, 12, 13], [21, 22, 23], [31, 32, 33]])
    >>> B = A[0]
    >>> A[0] = [1, 2, 3]

    Again, what is B[0] and why?


Q3. Given the following Python code:

    >>> A = array([11.0, 12.0, 13.0], Float32)
    >>> B = 2.0*A

    What type is B and why?

    (Note that real numbers in Python are internally stored as double
    precision floating-point numbers.)

------------------------------------------------------------------------

-- 
Dr. Paul Barrett       Space Telescope Science Institute
Phone: 410-338-4475    ESS/Science Software Group
FAX:   410-338-4767    Baltimore, MD 21218
_____________________________________________________
AstroPy mailing list  -  astropy at stsci.edu
http://lheawww.gsfc.nasa.gov/~bridgman/AstroPy/



More information about the AstroPy mailing list