Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #29911

Re: Pass numeric arrays from C extensions to Python

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!nntp.club.cc.cmu.edu!newsfeed.news.ucla.edu!usenet.stanford.edu!panix!not-for-mail
From Grant Edwards <invalid@invalid.invalid>
Newsgroups comp.lang.python
Subject Re: Pass numeric arrays from C extensions to Python
Date Mon, 24 Sep 2012 14:55:37 +0000 (UTC)
Organization PANIX Public Access Internet and UNIX, NYC
Lines 18
Message-ID <k3ps99$qmg$1@reader1.panix.com> (permalink)
References <05993015-7be1-4424-b062-1755f59f3142@googlegroups.com>
NNTP-Posting-Host dsl.comtrol.com
X-Trace reader1.panix.com 1348498537 27344 64.122.56.22 (24 Sep 2012 14:55:37 GMT)
X-Complaints-To abuse@panix.com
NNTP-Posting-Date Mon, 24 Sep 2012 14:55:37 +0000 (UTC)
User-Agent slrn/pre1.0.0-18 (Linux)
Xref csiph.com comp.lang.python:29911

Show key headers only | View raw


On 2012-09-24, JBT <jianbao.tao@gmail.com> wrote:

> I am looking for a way to pass numeric arrays, such as *float a[100];
> double b[200];*, from C extension codes to python. The use case of
> this problem is that you have data stored in a particular format,
> NASA common data format (CDF) in my case, and there exists an
> official C library to read/create/edit such data, and you want to do
> data analysis in python. The problem comes down to how to feed the
> data into python.

In a addition to scipy and scientific python (two different projects),
you should probably take a look at the struct module and the ctypes
module.

-- 
Grant Edwards               grant.b.edwards        Yow! Life is a POPULARITY
                                  at               CONTEST!  I'm REFRESHINGLY
                              gmail.com            CANDID!!

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Pass numeric arrays from C extensions to Python JBT <jianbao.tao@gmail.com> - 2012-09-23 18:39 -0700
  Re: Pass numeric arrays from C extensions to Python Terry Reedy <tjreedy@udel.edu> - 2012-09-23 22:48 -0400
  Re: Pass numeric arrays from C extensions to Python Grant Edwards <invalid@invalid.invalid> - 2012-09-24 14:55 +0000

csiph-web