Module Expr Str ImportFrom alias alias Import alias identifier ImportFrom alias Import alias FunctionDef arguments args defaults body Expr Str Assign TupleStore NameStore NameStore NameStore TupleLoad Num Num Num Assign NameStore Call AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad NameLoad Str Assign NameStore Num For NameStore Call NameLoad NameLoad body For NameStore Call NameLoad NameLoad body For NameStore Call NameLoad NameLoad body Assign SubscriptStore NameLoad Index TupleLoad NameLoad NameLoad NameLoad NameLoad AugAssignAdd NameStore Num Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Str Expr Call AttributeLoad NameLoad attr NameLoad ListLoad Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Str Expr Call AttributeLoad NameLoad attr NameLoad ListLoad Str keyword AttributeLoad NameLoad attr decorator_list FunctionDef arguments args defaults body Assign NameStore Call NameLoad Expr Call NameLoad Str Expr Call NameLoad NameLoad Expr Call NameLoad Str Expr Call NameLoad NameLoad Expr Call NameLoad Str Expr Call NameLoad NameLoad decorator_list If CompareEq NameLoad Str body Expr Call NameLoad
N/A N/A  A simple example to show how to access a 3D numpy array.  One
example shows how to access the numpy array using blitz type
converters and the other shows how it can be done without using blitz
by accessing the numpy array data directly.

 __future__ absolute_import print_function N/A scipy.weave weave scipy.weave converters N/A numpy create_array N/A N/A N/A N/A N/A Creates a simple 3D numpy array with unique values at each
    location in the matrix.

     N/A N/A rows cols depth N/A 2 3 4 N/A arr N/A N/A numpy zeros N/A rows cols depth i N/A count 0 N/A i N/A range rows N/A N/A j N/A range cols N/A N/A k N/A range depth N/A N/A N/A arr N/A N/A i j k count N/A count 1 N/A arr N/A pure_inline N/A N/A arr N/A N/A N/A Prints the given 3D array by accessing the raw numpy data and
    without using blitz converters.

    Notice the following:
      1. '\n' to escape generating a newline in the C++ code.
      2. rows, cols = Narr[0], Narr[1].
      3. Array access using arr[(i*cols + j)*depth + k].

     N/A code 
    int rows = Narr[0];
    int cols = Narr[1];
    int depth = Narr[2];
    for (int i=0; i < rows; i++)
    {
        for (int j=0; j < cols; j++)
        {
            printf("img[%3d][%3d]=", i, j);
            for (int k=0; k< depth; ++k)
            {
                printf(" %3d", arr[(i*cols + j)*depth + k]);
            }
            printf("\n");
        }
    }
     N/A N/A N/A weave inline code N/A arr N/A blitz_inline N/A N/A arr N/A N/A N/A Prints the given 3D array by using blitz converters which
    provides a numpy-like syntax for accessing the numpy data.

    Notice the following:
      1. '\n' to escape generating a newline in the C++ code.
      2. rows, cols = Narr[0], Narr[1].
      3. Array access using arr(i, j, k).

     N/A code 
    int rows = Narr[0];
    int cols = Narr[1];
    int depth = Narr[2];
    for (int i=0; i < rows; i++)
    {
        for (int j=0; j < cols; j++)
        {
            printf("img[%3d][%3d]=", i, j);
            for (int k=0; k< depth; ++k)
            {
                printf(" %3d", arr(i, j, k));
            }
            printf("\n");
        }
    }
     N/A N/A N/A weave inline code N/A arr type_converters N/A converters blitz N/A main N/A N/A N/A N/A N/A arr N/A create_array N/A N/A print numpy: N/A N/A print arr N/A N/A print Pure Inline: N/A N/A pure_inline arr N/A N/A print Blitz Inline: N/A N/A blitz_inline arr N/A N/A N/A __name__ __main__ N/A N/A N/A main