Re: [Numpy-discussion] Numpy doc string license

2010-05-20 Thread Keith Goodman
On Thu, May 20, 2010 at 7:38 PM, Robert Kern wrote: > On Thu, May 20, 2010 at 21:21, Keith Goodman wrote: >> I'd like to include modified numpy doc strings in my package. Do I >> just put a note in my license file that says my package contains numpy >> doc strings and then paste in the numpy lice

Re: [Numpy-discussion] astype None

2010-05-20 Thread Keith Goodman
On Thu, May 20, 2010 at 7:36 PM, wrote: > On Thu, May 20, 2010 at 9:00 PM, Keith Goodman wrote: >> While automating some unit tests for my labeled array class, larry, I >> assumed that >> >> np.array([1, 2], dtype=dtype) >> >> would give the same result as >> >> np.array([1, 2]).astype(dtype) >>

Re: [Numpy-discussion] Numpy doc string license

2010-05-20 Thread Robert Kern
On Thu, May 20, 2010 at 21:21, Keith Goodman wrote: > I'd like to include modified numpy doc strings in my package. Do I > just put a note in my license file that says my package contains numpy > doc strings and then paste in the numpy license? My package is > distributed under a Simplifed BSD lic

Re: [Numpy-discussion] astype None

2010-05-20 Thread josef . pktd
On Thu, May 20, 2010 at 9:00 PM, Keith Goodman wrote: > While automating some unit tests for my labeled array class, larry, I > assumed that > > np.array([1, 2], dtype=dtype) > > would give the same result as > > np.array([1, 2]).astype(dtype) > > But it doesn't for dtype=None: > >>> np.array([1,

[Numpy-discussion] Numpy doc string license

2010-05-20 Thread Keith Goodman
I'd like to include modified numpy doc strings in my package. Do I just put a note in my license file that says my package contains numpy doc strings and then paste in the numpy license? My package is distributed under a Simplifed BSD license, if that matters. __

[Numpy-discussion] astype None

2010-05-20 Thread Keith Goodman
While automating some unit tests for my labeled array class, larry, I assumed that np.array([1, 2], dtype=dtype) would give the same result as np.array([1, 2]).astype(dtype) But it doesn't for dtype=None: >> np.array([1, 2, 3], dtype=None) array([1, 2, 3]) >> np.array([1, 2, 3]).astype(None

Re: [Numpy-discussion] Problem in swig

2010-05-20 Thread Steven Nien
Hi Thanks for all your help! I found the "strange" result was caused by my algorithm(CUDA). The swig part is very ok:) On Thu, May 20, 2010 at 11:18 PM, Bill Spotz wrote: > I tried the following: > > %module example > %{ > #define SWIG_FILE_WITH_INIT > //#include "example.h" > %} > %include

Re: [Numpy-discussion] dtype and array creation

2010-05-20 Thread Pauli Virtanen
Thu, 20 May 2010 13:04:11 -0700, Keith Goodman wrote: > Why do the follow expressions give different dtype? > >>> np.array([1, 2, 3], dtype=str) > array(['1', '2', '3'], > dtype='|S1') >>> np.array(np.array([1, 2, 3]), dtype=str) > array(['1', '2', '3'], > dtype='|S8') Scalars seem to

Re: [Numpy-discussion] dtype and array creation

2010-05-20 Thread josef . pktd
On Thu, May 20, 2010 at 4:28 PM, Keith Goodman wrote: > On Thu, May 20, 2010 at 1:19 PM,   wrote: >> On Thu, May 20, 2010 at 4:04 PM, Keith Goodman wrote: >>> Why do the follow expressions give different dtype? >>> > np.array([1, 2, 3], dtype=str) >>> array(['1', '2', '3'], >>>      dtype='|S

Re: [Numpy-discussion] dtype and array creation

2010-05-20 Thread Keith Goodman
On Thu, May 20, 2010 at 1:19 PM, wrote: > On Thu, May 20, 2010 at 4:04 PM, Keith Goodman wrote: >> Why do the follow expressions give different dtype? >> np.array([1, 2, 3], dtype=str) >> array(['1', '2', '3'], >>      dtype='|S1') np.array(np.array([1, 2, 3]), dtype=str) >> array(['1'

Re: [Numpy-discussion] dtype and array creation

2010-05-20 Thread josef . pktd
On Thu, May 20, 2010 at 4:19 PM, wrote: > On Thu, May 20, 2010 at 4:04 PM, Keith Goodman wrote: >> Why do the follow expressions give different dtype? >> np.array([1, 2, 3], dtype=str) >> array(['1', '2', '3'], >>      dtype='|S1') np.array(np.array([1, 2, 3]), dtype=str) >> array(['1'

Re: [Numpy-discussion] dtype and array creation

2010-05-20 Thread josef . pktd
On Thu, May 20, 2010 at 4:04 PM, Keith Goodman wrote: > Why do the follow expressions give different dtype? > >>> np.array([1, 2, 3], dtype=str) > array(['1', '2', '3'], >      dtype='|S1') >>> np.array(np.array([1, 2, 3]), dtype=str) > array(['1', '2', '3'], >      dtype='|S8') you're on a 64bit

[Numpy-discussion] dtype and array creation

2010-05-20 Thread Keith Goodman
Why do the follow expressions give different dtype? >> np.array([1, 2, 3], dtype=str) array(['1', '2', '3'], dtype='|S1') >> np.array(np.array([1, 2, 3]), dtype=str) array(['1', '2', '3'], dtype='|S8') ___ NumPy-Discussion mailing list NumPy-

Re: [Numpy-discussion] question about creating numpy arrays

2010-05-20 Thread Darren Dale
On Thu, May 20, 2010 at 12:07 PM, Bruce Southey wrote: > np.array is an array creating function that numpy.array takes a > array_like input and it *will* try to convert that input into an array. > (This also occurs when you give np.array a masked array as an input.) > This a 'feature' especially w

Re: [Numpy-discussion] question about creating numpy arrays

2010-05-20 Thread josef . pktd
On Thu, May 20, 2010 at 12:13 PM, Benjamin Root wrote: > > > On Thu, May 20, 2010 at 10:30 AM, Ryan May wrote: >> >> On Thu, May 20, 2010 at 9:44 AM, Benjamin Root wrote: >> >> I gave two counterexamples of why. >> > >> > The examples you gave aren't counterexamples.  See below... >> > >> > On W

Re: [Numpy-discussion] question about creating numpy arrays

2010-05-20 Thread Benjamin Root
On Thu, May 20, 2010 at 10:30 AM, Ryan May wrote: > On Thu, May 20, 2010 at 9:44 AM, Benjamin Root wrote: > >> I gave two counterexamples of why. > > > > The examples you gave aren't counterexamples. See below... > > > > On Wed, May 19, 2010 at 7:06 PM, Darren Dale wrote: > >> > >> On Wed, May

Re: [Numpy-discussion] question about creating numpy arrays

2010-05-20 Thread Bruce Southey
On 05/20/2010 10:53 AM, Darren Dale wrote: > [sorry, my last got cut off] > > On Thu, May 20, 2010 at 11:37 AM, Darren Dale wrote: > >> On Thu, May 20, 2010 at 10:44 AM, Benjamin Root wrote: >> I gave two counterexamples of why. >>> The examples you gave aren't count

Re: [Numpy-discussion] question about creating numpy arrays

2010-05-20 Thread Darren Dale
[sorry, my last got cut off] On Thu, May 20, 2010 at 11:37 AM, Darren Dale wrote: > On Thu, May 20, 2010 at 10:44 AM, Benjamin Root wrote: >>> I gave two counterexamples of why. >> >> The examples you gave aren't counterexamples.  See below... > > I'm not interested in arguing over semantics. I'

Re: [Numpy-discussion] Problem in swig

2010-05-20 Thread Bill Spotz
I tried the following: %module example %{ #define SWIG_FILE_WITH_INIT //#include "example.h" %} %include "numpy.i" %init %{ import_array(); %} %apply (float* INPLACE_ARRAY1, int DIM1) {(float *a, int na), (float *b, int nb)}; %inline { void update_incident_field(int k, float *a, int n

Re: [Numpy-discussion] question about creating numpy arrays

2010-05-20 Thread Darren Dale
On Thu, May 20, 2010 at 10:44 AM, Benjamin Root wrote: >> I gave two counterexamples of why. > > The examples you gave aren't counterexamples.  See below... I'm not interested in arguing over semantics. I've discovered an issue with how numpy deals with lists of objects that derive from ndarray,

Re: [Numpy-discussion] question about creating numpy arrays

2010-05-20 Thread Ryan May
On Thu, May 20, 2010 at 9:44 AM, Benjamin Root wrote: >> I gave two counterexamples of why. > > The examples you gave aren't counterexamples.  See below... > > On Wed, May 19, 2010 at 7:06 PM, Darren Dale wrote: >> >> On Wed, May 19, 2010 at 4:19 PM,   wrote: >> > On Wed, May 19, 2010 at 4:08 PM,

Re: [Numpy-discussion] question about creating numpy arrays

2010-05-20 Thread Benjamin Root
> > I gave two counterexamples of why. > The examples you gave aren't counterexamples. See below... On Wed, May 19, 2010 at 7:06 PM, Darren Dale wrote: > On Wed, May 19, 2010 at 4:19 PM, wrote: > > On Wed, May 19, 2010 at 4:08 PM, Darren Dale wrote: > >> I have a question about creation of

Re: [Numpy-discussion] Runtime error in numpy.polyfit

2010-05-20 Thread Ralf Gommers
On Thu, May 20, 2010 at 10:17 AM, David Goldsmith wrote: > On Wed, May 19, 2010 at 3:50 PM, William Carithers wrote: > >> Hi David and Josef, >> >> OK, I updated to numpy-1.4.1 and scipy-0.7.2 and this problem went away. >> Thanks for your help. >> >> BTW, trying to upgrade using the .dmg files fr

Re: [Numpy-discussion] Problem in swig

2010-05-20 Thread Sebastian Haase
Hi, I don't know exactly, but try replacing the one line %apply (float* INPLACE_ARRAY1, int DIM1) {(float *a, int na), (float *b, int nb)}; with two lines: %apply (float* INPLACE_ARRAY1, int DIM1) {(float *a, int na)}; %apply (float* INPLACE_ARRAY1, int DIM1) {(float *b, int nb)}; Don't know abo