[Numpy-discussion] question np.partition

2015-01-29 Thread Neal Becker
It sounds like np.partition could be used to answer the question: give me the highest K elements in a vector. Is this a correct interpretation? Something like partial sort, but returned elements are unsorted. I could really make some use of this, but in my case it is a list of objects I need t

Re: [Numpy-discussion] 3D array and the right hand rule

2015-01-29 Thread Alexander Belopolsky
On Mon, Jan 26, 2015 at 6:06 AM, Dieter Van Eessen < dieter.van.ees...@gmail.com> wrote: > I've read that numpy.array isn't arranged according to the > 'right-hand-rule' (right-hand-rule => thumb = +x; index finger = +y, bend > middle finder = +z). This is also confirmed by an old message I dug up

Re: [Numpy-discussion] Datetime again

2015-01-29 Thread Scott Ransom
On 01/29/2015 09:58 AM, Chris Barker wrote: > > I was thinking elapsed time. Nanoseconds can be rather crude for that > > depending on the measurement. > > Wouldn't the user just keep elapsed time as a > count, or floating point number, in whatever units the instrument spits >

Re: [Numpy-discussion] Datetime again

2015-01-29 Thread Chris Barker
> > > I was thinking elapsed time. Nanoseconds can be rather crude for that > > depending on the measurement. > > Wouldn't the user just keep elapsed time as a > count, or floating point number, in whatever units the instrument spits > out? Why does it need to be treated in a different way from

Re: [Numpy-discussion] Views of a different dtype

2015-01-29 Thread Allan Haldane
Hello again, I also have a minor code comment: In get_object_offsets you iterate over dtype.fields.values(). Be careful, because dtype.fields also includes the field titles. For example this fails: dta = np.dtype([(('a', 'title'), 'O'), ('b', 'O'), ('c', 'i1')]) dtb = np.dtype([('a', 'O'

Re: [Numpy-discussion] Views of a different dtype

2015-01-29 Thread Nathaniel Smith
On Thu, Jan 29, 2015 at 12:56 AM, Jaime Fernández del Río wrote: [...] > With all these in mind, my proposal for the new behavior is that taking a > view of an array with a different dtype would require: > > That the newtype and oldtype be compatible, as defined by the algorithm > checking object

Re: [Numpy-discussion] Views of a different dtype

2015-01-29 Thread Allan Haldane
Hi Jamie, I'm not sure whether to reply here or on github! I have a comment on the condition "There must be the same total number of objects before and after". I originally looked into this to solve https://github.com/numpy/numpy/issues/3256, which involves taking a view of a subset of the field

Re: [Numpy-discussion] Datetime again

2015-01-29 Thread Charles R Harris
On Thu, Jan 29, 2015 at 12:55 AM, Eric Firing wrote: > On 2015/01/28 6:29 PM, Charles R Harris wrote: > > > > > > And as for "The 64 bits of long long really isn't enough and leads > > to all sorts of compromises". not long enough for what? I've always > > thought that what we need is