Hi,

See http://mathesaurus.sourceforge.net/matlab-numpy.html for
concatenate commands etc.

c = numpy.concatenate((a,b), axis=1)

is not exactly what you want but should help although you have a
repeat of the first column. The following is untested but might help.


def remove(arr, index, dim=0):
    """Remove subarray at index and dimension specified"""
    # make selected dimension the first one
    swparr = numpy.swapaxes(arr, 0, dim)
    indices = range(swparr.shape[0])
    del indices[index]
    newarray = swparr[indices]
    # reorder axes as they originally appeared.
    return numpy.swapaxes(newarray, 0, dim)


Then you can say

a = remove(a, 0)

to remove the 1st row or

c = remove(c, 2, dim=1)

to remove the 3rd column.

Cheers,
Adam
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to