0

This is an extension to my previous question found in C code within python and copying arrays in C code

Serberg suggested I use PyArray_CopyInto functions from NUMPY. I am new to both python and C though I know a little bit of both. I am trying to learn how to fix the above problem and wondered what I could get some basic knowledge of C extensions?

I did look at the official page of python but its a bit difficult to understand for me.

Any suggestions?

Community
  • 1
  • 1
Steve Grafton
  • 1,821
  • 4
  • 17
  • 18

2 Answers2

0

I don't know about an official tutorial, but you should have a look at the following:

  • any existing extensions
  • the C API documentation
    • which also teaches about the concept of owning, stealing and borrowing references
glglgl
  • 89,107
  • 13
  • 149
  • 217
0

Take a look at these two sites:

  1. Array API
  2. Array Iterator API

In the 2nd link take a look at the "Simple Multi-Iteration Example". It copies one array into another. In the 1st link, take a look at PyArray_NewCopy.

Joel Vroom
  • 1,611
  • 1
  • 16
  • 30