Paste number 60611: arrays

Paste number 60611: arrays
Pasted by: tachim
5 days, 3 hours ago
None
Paste contents:
Raw Source | XML | Display As
import scipy, numpy

def build_cool_grid(x,y,z=0):
    if z = 0:
        arr = numpy.empty((x,y))
    else:
        arr = numpy.empty((x,y,z))

    print 'still going'

    if z > 0:
        for i in range(0,(x-1)/3):
            for j in range(0,(y-1)/3):
                for k in range(0,(z-1)/3):
                    arr[i,j,k] = (5.0,1.0,1.0)
    else:
        for i in range(0,(x-1)/3):
            for j in range(0,(y-1)/3):
                print i,j
                arr[i,j] = (5.0,1.0)

    return arr

This paste has no annotations.

Colorize as:
Show Line Numbers

Ads absolutely not by Google

Lisppaste pastes can be made by anyone at any time. Imagine a fearsomely comprehensive disclaimer of liability. Now fear, comprehensively.