Error: 'numpy.ndarray' object has no attribute 'strip'
Reverting to numpy 1.0.1 works fine for the same code. So the question
is, does scipy need an update, or did something unintended creep into
Numpy 1.0.2? (Hence the cross-post)
Ryan
--
Ryan May
Graduate Research A
Travis Oliphant wrote:
> Ryan May wrote:
>
>> Hi,
>>
>> As far as I can tell, the new Numpy 1.0.2 broke scipy.io.loadmat.
>>
>>
> Yes, it was the one place that scipy used the fact that field selection
> of a 0-d array returned a scalar. This has be
ncy with scalar operation made
debugging my problem more difficult.
Ryan
--
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman
you're looking for is numpy.memmap, though the documentation is
eluding me at the moment.
Ryan
--
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion
ace is
ignored).
Ryan
--
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion
This has to be one of the most bizarre threads I've ever read in my life.
Somehow companies are lurking around like the boogeyman and academics are
completely free of ulterior motives and conflicts of interest? This is just
asinine--we're all people and have various motivations. (Having just gotten
On Fri, Sep 25, 2015 at 3:02 PM, Nathaniel Smith wrote:
>
> The coroutines in 3.5 are just syntactic sugar around features that were
> added in *2*.5 (yield expressions and yield from), so no need to wait :-).
> They fall far short of arbitrary continuations, though.
>
Correction: Python 3.4 gain
rden Street, MS 83
> phone: (617) 496-7981 Cambridge, MA 02138-1516
> cell: (781) 363-0035 USA
>
>
>
> ___
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> https://mail.scipy.org/mailman/listinfo/numpy-discussion
>
>
--
Ryan May
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
https://mail.scipy.org/mailman/listinfo/numpy-discussion
WA 98115 (206) 526-6317 main reception
> chris.bar...@noaa.gov
>
> ___
> NumPy-Discussion mailing
> listNumPy-Discussion@scipy.orghttps://mail.scipy.org/mailman/listinfo/numpy-discussion
>
>
>
>
> ____
one way or another before I can move
forward in my corner of the world, and I have time I can dedicate to
implementing a solution.
Ryan
--
Ryan May
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
https://mail.scipy.org/mailman/listinfo/numpy-discussion
n the Python Compilers Workshop
> and my talk, but do you want to meet up Thursday maybe?
>
> -n
>
> On Sat, Jul 9, 2016 at 6:44 PM, Ryan May wrote:
> > Greetings!
> >
> > I've been beating my head against a wall trying to work seamlessly with
> > pint's
on?
>
> Nathan
>
>
> On Sunday, July 10, 2016, Ryan May wrote:
>
>> Hi Nathaniel,
>>
>> Thursday works for me; anyone else interested is welcome to join.
>>
>> Ryan
>>
>> On Sun, Jul 10, 2016 at 12:20 AM, Nathaniel Smith wrote:
>>
ral solution is a good goal--just that units is my
"sine qua non". Also, I would have love to have heard that someone solved
the unit + ndarray-like thing problem. :)
Ryan
--
Ryan May
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.o
ystem generally, rather than specifically about unit support. (though unit
> support is a great use-case to focus on)
>
>
So Thursday's options seem to be in the standard BOF slot (up against the
Numfocus BOF), or doing something that evening, which would overlap at
least part of multipl
Fine with me.
Ryan
On Thu, Jul 14, 2016 at 12:48 AM, Nathaniel Smith wrote:
> I have something at lunch, so dinner would be good for me too.
> On Jul 13, 2016 7:46 PM, "Charles R Harris"
> wrote:
>
>> Evening would work for me. Dinner?
>> On Jul 13, 2016 2:4
Sounds good.
On Thu, Jul 14, 2016 at 10:51 AM, Nathan Goldbaum
wrote:
> Fine with me as well. Meet in the downstairs lobby after the lightning
> talks?
>
> On Thu, Jul 14, 2016 at 10:49 AM, Ryan May wrote:
>
>> Fine with me.
>>
>> Ryan
>>
>> On T
On Sun, Oct 9, 2016 at 12:59 PM, Stephan Hoyer wrote:
> On Sun, Oct 9, 2016 at 6:25 AM, Sebastian Berg > wrote:
>
>> For what its worth, I still feel it is probably the only real option to
>> go with error, changing to float may have weird effects. Which does not
>> mean it is impossible, I admi
eval function:
https://docs.python.org/3/library/functions.html#eval
?
Ryan
--
Ryan May
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
https://mail.scipy.org/mailman/listinfo/numpy-discussion
ment, so it can work similarly to np.stack.
>
itertools.product, itertools.permutation, etc. with np.fromiter (and
reshape) is probably also useful here, though it doesn't solve the
non-scalar problem.
Ryan
--
Ryan May
___
NumPy-Discussi
On Mon, Mar 22, 2010 at 8:14 AM, Ryan May wrote:
> On Sun, Mar 21, 2010 at 11:57 PM, wrote:
>> On Mon, Mar 22, 2010 at 12:49 AM, Ryan May wrote:
>>> Hi,
>>>
>>> I found that trapz() doesn't work with subclasses:
>>>
>>> http://
On Sat, Mar 27, 2010 at 11:12 AM, wrote:
> On Sat, Mar 27, 2010 at 1:00 PM, Ryan May wrote:
>> On Mon, Mar 22, 2010 at 8:14 AM, Ryan May wrote:
>>> On Sun, Mar 21, 2010 at 11:57 PM, wrote:
>>>> On Mon, Mar 22, 2010 at 12:49 AM, Ryan May wrote:
>>&g
nterface code.)
Yeah, it's kind of annoying, since the 10% is the cool part you want,
and that 90% is thorny to design and boring to code.
Ryan
--
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion
On Mon, Mar 29, 2010 at 8:00 AM, Bruce Southey wrote:
> On 03/27/2010 01:31 PM, Ryan May wrote:
>> Because of the call to asarray(), the mask is completely discarded and
>> you end up with identical results to an unmasked array,
>> which is not what I'd expect. Worse, t
think this addresses the concerns that were raised about the changes
for subclasses in this case. Let me know if I've missed something (or
if there's no way in hell any such patch will ever be committed).
Thanks,
Ryan
--
Ryan May
Graduate Research Assistant
School of Meteorology
Un
here
> are probably simple ways to do it without mixing distutils in.
Out of curiosity, is there something wrong with the support for 2to3
that already exists within distutils? (Other than it just being
distutils)
http://bruynooghe.blogspot.com/2010/03/using-lib2to3-in-setuppy.htm
On Tue, Mar 30, 2010 at 11:12 AM, Alan G Isaac wrote:
> On 3/30/2010 12:56 PM, Sean Mulcahy wrote:
>> 512x512 arrays. I would like to set elements of the array whose value fall
>> within a specified range to zero (eg 23< x< 45).
>
> x[(23http://mail.scipy.org/mailman/listinfo/numpy-discussion
On Tue, Mar 30, 2010 at 3:16 PM, Friedrich Romstedt
wrote:
> 2010/3/30 Ryan May :
>> On Tue, Mar 30, 2010 at 11:12 AM, Alan G Isaac wrote:
>>> On 3/30/2010 12:56 PM, Sean Mulcahy wrote:
>>>> 512x512 arrays. I would like to set elements of the array whose value
On Tue, Mar 30, 2010 at 3:40 PM, Robert Kern wrote:
> On Tue, Mar 30, 2010 at 16:35, Ryan May wrote:
>> On Tue, Mar 30, 2010 at 3:16 PM, Friedrich Romstedt
>> wrote:
>
>>> x *= ((x <= 23) | (x >= 45)) .
>>
>> Interesting. In an ideal world, I
t;license" for more information.
>>> import numpy as np
>>> np.logaddexp2(-0.5849625007211563, -53.584962500721154)
-0.58496250072115619
>>> np.logaddexp2(-1.5849625007211563, -53.584962500721154)
-1.5849625007211561
>>> np.version.version
'2.0.0.dev8313'
R
pty
> array and non-empty array( irrespective to what is inside array).
But by using:
if not b[0]:
You're not considering the array as a whole, you're looking at the
first element, which is giving expected results. As I'm sure you're
aware,
On Fri, Apr 2, 2010 at 8:31 AM, Robert Kern wrote:
> On Fri, Apr 2, 2010 at 08:28, Ryan May wrote:
>> On Thu, Apr 1, 2010 at 10:07 PM, Shailendra
>> wrote:
>>> Hi All,
>>> Below is some array behaviour which i think is odd
>>>>>> a=arange(1
; fails. Although single assignment works:
>
> I[13]: basic.data['Air_Temp'].data[0] = 30
>
> Shouldn't this be working like the regular NumPy arrays do?
Based on the traceback, I'd say it's because you're trying to replace
the object pointed to by the .data at
tion--it strips away information contained in the class, and
IMHO should not be the default behavior. If I want the objects, I can
force it:
In [7]: np.array([a,b],dtype=np.object)
Out[7]: array([2.0 m, 1.0 s], dtype=object)
This works fine, but feels ugly since I have to explicitly tell numpy
C somewhere, at least at the BOF, this exact syntax was intended to
be supported.
Ryan
--
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion
),dtype='d') works but seems cumbersome
atleast_1d(d).astype('d')
Ryan
--
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion
g about using asanyarray(). If you encounter a
basic numpy function that calls asarray() but would work fine with
masked arrays (or other subclasses), feel free to file/post as a bug.
It's good to get those cases fixed where possible. (I've done this in
t
)).shape
> Out[8]: (3, 4, 5, 6, 2)
>
> So it behaves just like insert. But "len(a.shape)" is rather
> cumbersome, especially if you haven't given a a name yet:
It's available as a.ndim
Ryan
--
Ryan May
Graduate Rese
re, but this seems like a better use for masked
arrays, not NaN's. Masked arrays were specifically designed to add
functions that work well with masked/invalid data points. Why reinvent the
wheel here?
Ryan
--
Ryan May
Graduate Research Assistant
School of Meteorology
University of Okl
rray([[ 2., 3.],
[ 5., 6.]])
Was it a conscious design decision that the usecols no longer accept
arrays? The new behavior (in 1.1.1) breaks existing code that one of my
colleagues has. Can we get a patch in before 1.2 to get this working
with arrays again?
Thanks,
Ryan
--
Travis E. Oliphant wrote:
> Ryan May wrote:
>> Stefan (or anyone else who can comment),
>>
>> It appears that the usecols argument to loadtxt no longer accepts numpy
>> arrays:
>>
>
> Could you enter a ticket so we don't lose track of this. I
r side ?
>
I can confirm that it works fine for me. Can you or someone else
backport this to the 1.2 branch so that this bug is fixed in the next
release?
Thanks,
Ryan
--
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
___
Thanks a bunch for getting these done.
David Huard wrote:
> Done in r5790.
>
> On Fri, Sep 5, 2008 at 12:36 PM, Ryan May <[EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]>> wrote:
>
> David Huard wrote:
> > Hi Ryan,
> >
> > I appl
machine.
>
> I am telling you all the time Robert to use Debian that it just works
> and you say, no no, gentoo is the best. :)
And what's wrong with that? :) Once you get over the learning curve,
Gentoo works just fine. Must be Robert K.'s fault. :)
Ryan
--
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion
'3c7']],
>
>
> dtype='|S3')
>
It's because of how numpy handles strings arrays (which I admit I don't
understand very well.) Basically, it's converting the numbers properly,
but truncating them to 3 characters. Try this, which just forces it to
expand to strings 4 c
you
have? For an array object A, A.shape should give the shape you're
expecting.
Ryan
--
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion
a curt answer, it certainly wasn't meant to
> be rude. Many of us also sprinkle our responses with a liberal dose
> of Tongue In Cheek :)
>
> It looks like you received some good answers to your question, but let
> us know if your problems persist and we'll help you sort it
Hi,
I noticed numpy.loadtxt has support for gzipped text files, but not for
bz2'd files. Here's a 3 line patch to add bzip2 support to loadtxt.
Ryan
--
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
Index: numpy
Charles R Harris wrote:
> On Tue, Oct 21, 2008 at 1:30 PM, Ryan May <[EMAIL PROTECTED]> wrote:
>
>> Hi,
>>
>> I noticed numpy.loadtxt has support for gzipped text files, but not for
>> bz2'd files. Here's a 3 line patch to add bzip2 support to loadtx
7;notify:', args
>
>
> with also overriding setslice?
I haven't given this much thought, but you'd also likely need to do this
for the infix operators (+=, etc.).
Ryan
--
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion
for fixing/adding small
things like this.)
Ryan
--
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion
Pauli Virtanen wrote:
> Hi,
>
> Wed, 12 Nov 2008 10:16:35 -0600, Ryan May wrote:
>> Here's a quick diff to fix some typos in the docstrings for matlib.zeros
>> and matlib.ones. They're causing 2 (of many) failures in the doctests
>> for me on SVN HEAD.
>
he index goes, that would be:
def setval(array, index, value, axis=0):
slices = [slice(None)] * len(array.shape)
slices[axis] = index
array[slices] = value
(Adapted from the code for numpy.diff)
Ryan
--
Ryan May
Graduate Research Assista
aise a TypeError if it's incompatible.
Thoughts? I'm willing to write up the patch for either
.
Ryan
--
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion
Stéfan van der Walt wrote:
> 2008/11/20 Ryan May <[EMAIL PROTECTED]>:
>> Does anyone know why numpy.loadtxt(), in checking the validity of a
>> filehandle, checks for the seek() method, which appears to have no
>> bearing on whether an object will work?
>
> I thi
in this code requires a bit of boilerplace (declaring
dtypes, converters). While it's nothing I can't write, it still would be
easier to write it once within loadtxt and have it for everyone.
Any support for *any* of these ideas? Any suggestions on how the user
should pass in the informatio
27;m currently cooking up some of these changes myself, but thought I
would see what you thought first.
Ryan
--
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion
Pierre GM wrote:
> On Nov 25, 2008, at 2:06 PM, Ryan May wrote:
>> 1) It looks like the function returns a structured array rather than a
>> rec array, so that fields are obtained by doing a dictionary access.
>> Since it's a dictionary access, is there any reason that
> On Nov 25, 2008, at 2:37 PM, Ryan May wrote:
>> What about doing the parsing and type inference in a loop and holding
>> onto the already split lines? Then loop through the lines with the
>> converters that were finally chosen? In addition to making my usecase
>> wo
urned by np.loadtxt() (by
masking on the appropriate fill value)?
>> I'll post that when I'm done and we can see if it looks like too much
>> functionality stapled together or not.
>
> Sounds like a plan. Wouldn't mind getting more feedback from fellow
> user
lcome any and all suggestions here, both on the code and on the
original idea of adding these capabilities to loadtxt().
Ryan
--
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
Index: lib/io.py
===
d converter function fails, the
user should know. (Though I got this wrong the first time.)
> * I'd probably get rid of StringConverter._get_from_dtype, as it is not
> needed outside the __init__. You may wanna stick to the original __init__.
Done.
R
Pierre GM wrote:
> On Nov 25, 2008, at 10:02 PM, Ryan May wrote:
>> Pierre GM wrote:
>>> * Your locked version of update won't probably work either, as you
>>> force
>>> the converter to output a string (you set the status to largest
>>> possibl
ifying dtype=numpy.float32
or dtype=numpy.int32.
Ryan
--
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion
Pierre GM wrote:
On Nov 25, 2008, at 10:02 PM, Ryan May wrote:
Pierre GM wrote:
* Your locked version of update won't probably work either, as you
force
the converter to output a string (you set the status to largest
possible, that's the one that outputs strings). Why don
John Hunter wrote:
> On Tue, Nov 25, 2008 at 11:23 PM, Ryan May <[EMAIL PROTECTED]> wrote:
>
>> Updated patch attached. This includes:
>> * Updated docstring
>> * New tests
>> * Fixes for previous issues
>> * Fixes to make new tests actually wo
Manuel Metz wrote:
> Ryan May wrote:
>> 3) Better support for missing values. The docstring mentions a way of
>> handling missing values by passing in a converter. The problem with this is
>> that you have to pass in a converter for *every column* that will contain
>&
ile and get a structured array with an automatically detected dtype
(names and types!) plus masked values.
My $0.02.
Ryan
--
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion
of loadtxt(), feel free
to use it. I'm more than capable of wrapping the urlopen() object within a
StringIO. However, I am unconvinced that removing the 2nd loop and instead
redoing the reading from the file will be much (if any) of a speed win.
Ryan
--
Ryan
d as the delimiter, but when an explicit delimiter has been
> provided, it strikes me that the code shouldn't try to further-
> interpret it...
>
> Does anyone else have any opinion here?
I agree. If the user explicity passes something as a delimiter, we
should use it and not try to be too smart.
+1
Ryan
--
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion
who sees certain casing of names in the
file and expects that data to be laid out the same.
Other than those, it's working fine for me here.
Ryan
--
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
___
Numpy-discussi
object arrays, or rather, a field containing objects, specifically
datetime objects? Right now, this does not work because calling view
does not work for object arrays. I'm just looking for a simple way to
store date/time in my record array (currently a string field).
Ryan
--
more than welcome,
> as usual.
>
> Anyhow: as we do need speed, I suggest we put genloadtxt somewhere in
> numpy.ma, with an alias recfromcsv for John, using his defaults. Unless
> somebody comes with a brilliant optimization.
Why only in numpy.ma and not somewhere in core numpy itsel
ge.
>
> And so, now what ? Should I put the module in numpy.lib.io ? Elsewhere ?
>
> Thx for any comment and suggestions.
Current version works out of the box for me.
Thanks for running point on this.
Ryan
--
Ryan May
Graduate Research Assistant
School
>>b.data
array([ 5, 10, 15, 20, 25])
I was expecting that the underlying data wouldn't get modified while masked.
Is
this actual behavior expected?
Ryan
--
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
__
re
against
the converted value from the file to determine if missing. (Probably very slow)
2) Add a list of objects (ints, floats, etc.) to compare against after
conversion
to determine if they're missing. This might needlessly complicate the function,
which I know you've alrea
ere that calling it loadtxt would be a disservice to how
much
the new function can do (and how much work you've done).
Ryan
--
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
___
Numpy-discussion m
Pierre GM wrote:
> On Dec 16, 2008, at 1:57 PM, Ryan May wrote:
>> I just noticed the following and I was kind of surprised:
>>
>>>>> a = ma.MaskedArray([1,2,3,4,5], mask=[False,True,True,False,False])
>>>>> b = a*5
>>>>> b
>> maske
ata = np.empty(N, dtype=dt)
data['age'] = np.random.randint(0, 99, 10e6)
data['weight'] = np.random.randint(0, 200, 10e6)
data['age'] += 1
Timing for recarrays (your code):
In [10]: timeit data.age += 1
10
; a[i,j,2] = a[i,j,0]
> a[i,j,1] = a[i,j,2]
>
> end = time.clock() - start
>
> print "Test done, %f sec" % end
> #
> Any idea on it ?
> Did I missed something ?
I think you may have reduced the complexity a bit too much. The python cod
go along?
Any insight would be appreciated.
Ryan
--
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion
x27;2,5', dtype=None)
print a.dtype
Ryan
--
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion
y. On one
hand I'd love for things to behave differently in this case, but on the other I
understand why things work this way.
Ryan
>
> On Jan 24, 2009, at 5:58 PM, Ryan May wrote:
>
>> Pierre,
>>
>> I've found what I consider to be a bug in the new mafromtxt
Pierre GM wrote:
> On Jan 24, 2009, at 6:23 PM, Ryan May wrote:
>> Ok, thanks. I've dug a little further, and it seems like the
>> problem is that a
>> column of all missing values ends up as a column of all None's.
>> When you create
>> a (mask
a = a+1
>
> a.ctypes.data points to a different memory location (this is actually an
> even bigger problem when executing fftw plans), however
> type(a) still gives me .
This might help some:
http://www.scipy.org/Subclasses
Ryan
--
Ryan May
Graduate Res
dtype and I'll try to put together a patch.
Thanks,
Ryan
P.S. Thanks so much for your work on putting those utility functions in
recfunctions.py It makes it so much easier to have these functions available in
the library itself rather than needing to reinvent the wheel over and over.
,2,3)], mask=[(0,1,0)], dtype=[(('a','A'),int),
(('b','B'),bool), (('c','C'),float)])
>>> b = ma.array([(4,5,6)], dtype=[(('a','A'),int), (('b','B'),float),
(('c','C'),floa
ill with
> zeros. Anything else is counter-intuitive. Calling numpy.ones to fill
> with fives makes no sense to me. But I would be +1 on having a function
> called numpy.values or numpy.fill that would create and fill an ndarray
> with arbitrary values.
I completely agree here.
R
e tricks? I think I remember some
> discussion of this a while back.
I think that's right, but at that point, what gain is that over using a regular
constant and relying on numpy's broadcasting?
Ryan
--
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
_
ot sure about whether or not its optimized, but I can tell you that the
"mystery" 4 bytes are the number of bytes it that wrote out followed by that
number of bytes of data.
Ryan
--
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion
number of bytes that will
follow, *then* the actual data. So, for instance, the first write to file in
your program will write the bytes corresponding to these values:
16 X(1) Y(1) Z(1)
The 16 comes from the size of 2 ints and 1 double. Since you're always writing
out the 3 values, and
Nils Wagner wrote:
> On Mon, 02 Feb 2009 10:17:13 -0600
> Ryan May wrote:
>> Every write statement in fortran first writes out the
>> number of bytes that will
>> follow, *then* the actual data. So, for instance, the
>> first write to file in
>&g
3.4484552433329538e-313),
> (0, 16, 0, 5.2413296037731544e-312),
> (0, 1077805056, 16, 3.3951932655444357e-313), (0,
> 19, 246, 27.0),
> (16, 0, 16, 4.2439915819305446e-313),
> (245, 0, 1077411840, 7.9050503334599447e-323)],
>dtype=[('isize
Nils Wagner wrote:
> On Mon, 02 Feb 2009 14:07:35 -0600
> Ryan May wrote:
>> Nils Wagner wrote:
>>>>> Is this a 64-bit problem ?
>>>>>
>>>> I don't know if it's a 64-bit problem per-se, so much as
>>>> a d
: time data did not match format: data=0 fmt=%Y-%m-%d %H:%M:%SZ
Which comes from a part of the code in updating converters where it passes the
string '0' to the converter. Are the converters expected to handle what amounts
to bad input even though the file itself has no such
Pierre GM wrote:
> On Feb 3, 2009, at 11:24 AM, Ryan May wrote:
>
>> Pierre,
>>
>> Should the following work?
>>
>> import numpy as np
>> from StringIO import StringIO
>>
>> converter = {'date':lambda s: datetime.strptime(s,'%
Ryan May wrote:
> Pierre,
>
> I know you did some preliminary work on helping to make sure that doing
> operations on masked arrays doesn't change the underlying data. I ran into
> the
> following today.
>
> import numpy as np
> a = np.ma.array([1,2,3], mask=[F
values end up with
the value of the scalar. If this is getting too hairy to handle not touching
data, I understand. I just thought I should point out the inconsistency here.
Ryan
--
Ryan May
Graduate Research Assistant
School of Meteorology
University o
Pierre GM wrote:
> On Feb 3, 2009, at 4:00 PM, Ryan May wrote:
>> Well, I guess I hit send too soon. Here's one easy solution
>> (consistent with
>> what you did for __radd__), change the code for __rmul__ to do:
>>
>> return multiply(self, othe
Hi,
Ok, what am I missing here:
x = np.array([[4,2],[5,3]])
x[x.argsort(1)]
array([[[5, 3],
[4, 2]],
[[5, 3],
[4, 2]]])
I was expecting:
array([[2,4],[3,5]])
Certainly not a 3D array. What am I doing wrong?
Ryan
--
Ryan May
Graduate Research Assistant
School of
t want to make any assumptions, it becomes the
> > user's responsibility to do it manually.
>
> I don't think there is *any* sane way of numpy propagating the user's
> metadata. The user must be the one to do it.
>
I'm +1 on all of what Robert said.
1 - 100 of 175 matches
Mail list logo