[Numpy-discussion] How to call import_array() properly?

Robert Kern robert.kern@gmail....
Mon Dec 27 09:20:14 CST 2010


On Sun, Dec 26, 2010 at 17:26, Bruce Sherwood <Bruce_Sherwood@ncsu.edu> wrote:
> In my Python code I have
>
> import cvisual
> cvisual.init_numpy()
>
> and in my C++ code I have
>
> void
> init_numpy()
> {
>    import_array();
> }

The import_array() call goes into the initialization function for your
module, e.g. initcvisual(). Do not put it into a separate function for
the user of your module to call.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
  -- Umberto Eco


More information about the NumPy-Discussion mailing list