Bryan Fodness wrote:
> I tried posting this to numpy, but my posts never show up.

odd -- it works fine for me -- are you subscribed?

anyway:

 >>> import numpy as np
 >>> a = np.arange(100).reshape((10,10))
 >>> b = np.ones((5,7)) * 30
 >>> a
array([[ 0,  1,  2,  3,  4,  5,  6,  7,  8,  9],
        [10, 11, 12, 13, 14, 15, 16, 17, 18, 19],
        [20, 21, 22, 23, 24, 25, 26, 27, 28, 29],
        [30, 31, 32, 33, 34, 35, 36, 37, 38, 39],
        [40, 41, 42, 43, 44, 45, 46, 47, 48, 49],
        [50, 51, 52, 53, 54, 55, 56, 57, 58, 59],
        [60, 61, 62, 63, 64, 65, 66, 67, 68, 69],
        [70, 71, 72, 73, 74, 75, 76, 77, 78, 79],
        [80, 81, 82, 83, 84, 85, 86, 87, 88, 89],
        [90, 91, 92, 93, 94, 95, 96, 97, 98, 99]])
 >>> b
array([[ 30.,  30.,  30.,  30.,  30.,  30.,  30.],
        [ 30.,  30.,  30.,  30.,  30.,  30.,  30.],
        [ 30.,  30.,  30.,  30.,  30.,  30.,  30.],
        [ 30.,  30.,  30.,  30.,  30.,  30.,  30.],
        [ 30.,  30.,  30.,  30.,  30.,  30.,  30.]])
 >>> a[3:8, 2:9] += b
 >>> a
array([[  0,   1,   2,   3,   4,   5,   6,   7,   8,   9],
        [ 10,  11,  12,  13,  14,  15,  16,  17,  18,  19],
        [ 20,  21,  22,  23,  24,  25,  26,  27,  28,  29],
        [ 30,  31,  62,  63,  64,  65,  66,  67,  68,  39],
        [ 40,  41,  72,  73,  74,  75,  76,  77,  78,  49],
        [ 50,  51,  82,  83,  84,  85,  86,  87,  88,  59],
        [ 60,  61,  92,  93,  94,  95,  96,  97,  98,  69],
        [ 70,  71, 102, 103, 104, 105, 106, 107, 108,  79],
        [ 80,  81,  82,  83,  84,  85,  86,  87,  88,  89],
        [ 90,  91,  92,  93,  94,  95,  96,  97,  98,  99]])
 >>>



-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

[EMAIL PROTECTED]

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to