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.
--
Ryan May
Graduate Research
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 (masked) array from a list of None's, you end up with an object
(this is actually an
even bigger problem when executing fftw plans), however
type(a) still gives me class 'fftw3.planning.AlignedArray'.
This might help some:
http://www.scipy.org/Subclasses
Ryan
--
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
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
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 (though
apparently it
existed in earlier versions as well). If you have an entire column
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
think you may have reduced the complexity a bit too much. The python code
above sets all of the elements equal to a[i,j,1]. Is there any reason you can't
use slicing to avoid the loops?
Ryan
--
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
ms per loop
Timing for my example:
In [2]: timeit data['age']+=1
10 loops, best of 3: 150 ms per loop
Hope this helps.
Ryan
--
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
___
Numpy-discussion mailing list
Numpy
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 mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org
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
masked_array(data = [5 -- -- 20 25],
mask = [False True True False False
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
___
Numpy-discussion mailing list
Numpy-discussion
(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 already taken pains to optimize.
If there's no good way to do it, I'm content to live with a workaround.
Ryan
--
Ryan May
Graduate
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 of Meteorology
University of Oklahoma
and not somewhere in core numpy itself (missing
values aside)? You have a pretty good masked array agnostic wrapper
that IMO could go in numpy, though maybe not as loadtxt.
Ryan
--
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
, 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
--
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
Proposal :
Here's an extension
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
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-discussion mailing list
Numpy
.
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
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 work
I appreciate any and all feedback.
I'm having trouble
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
missing values. If you have a text
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 information?
Thanks,
Ryan
--
Ryan May
Graduate
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 the header
needs to be munged
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
work, this has the benefit of not doing
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
users before we get too deep, however...
Agreed. Anyone?
--
Ryan May
Graduate Research Assistant
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
===
--- lib/io.py (revision 6099)
+++ lib
.)
* 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.
Ryan
--
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
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't you set
=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't you set
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 think this is simply a naive mistake on my part
/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.
There are probably bound to be more
, 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 Assistant
School of Meteorology
University of Oklahoma
, self).__setitem__(*args)
def notify(self, *args):
print '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
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 loadtxt.
Ryan
--
Ryan May
Graduate Research Assistant
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/lib/io.py
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 out.
Well said.
Ryan
--
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
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
, 32-bit 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
={0:lambda
s:int(s,16)})
HTH,
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
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
___
Numpy-discussion mailing
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 applied your patch in r5788 on the trunk.
I noticed
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
--
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
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 don't
remember anything being intentional.
Done: #905
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 Oklahoma
___
Numpy-discussion mailing list
Numpy
', 25.301), ('BOB', 27.899)],
dtype=[('stid', '|S4'), ('temp', 'f8')])
Thanks,
Ryan
--
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
--
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
--- io.py.bak 2008-07-18
]:
masked_array(data = --,
mask = True,
fill_value=1e+20)
In [12]: np.__version__
Out[12]: '1.1.0'
Is there a reason that the fill_value isn't inherited from the parent array?
Ryan
--
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
Eric Firing wrote:
Ryan May wrote:
Hi,
I just noticed this and found it surprising:
In [8]: from numpy import ma
In [9]: a = ma.array([1,2,3,4],mask=[False,False,True,False],fill_value=0)
In [10]: a
Out[10]:
masked_array(data = [1 2 -- 4],
mask = [False False True False
this in for 1.1.1?
Thanks,
Ryan
--
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
--- io.py.bak 2008-07-18 18:12:17.0 -0400
+++ io.py 2008-07-16 22:49:13.0 -0400
@@ -292,8 +292,13 @@
if converters is None:
converters
,axis=axis)
nd = len(y.shape)
slice1 = [slice(None)]*nd
slice2 = [slice(None)]*nd
slice1[axis] = slice(1,None)
slice2[axis] = slice(None,-1)
return add.reduce(d * (y[slice1]+y[slice2])/2.0,axis)
For me, this works fine with supplying x for axis != -1.
Ryan
--
Ryan May
add an extra dimension to
the end. Once I resize x, I can get this to work. You might want to
look at this: http://www.scipy.org/EricsBroadcastingDoc
Ryan
--
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
matplotlib code.
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
Robert Kern wrote:
On Tue, Jul 1, 2008 at 19:19, Ryan May [EMAIL PROTECTED] wrote:
Robert Kern wrote:
On Tue, Jul 1, 2008 at 17:50, Fernando Perez [EMAIL PROTECTED] wrote:
On Tue, Jul 1, 2008 at 1:41 PM, Pauli Virtanen [EMAIL PROTECTED] wrote:
But it's a custom tweak to doctest, so it might
as module functions?
Hi Bob,
this is a very good question.
I think the answers are
a) historical reasons AND, more importantly, differing personal preferences
b) I would file the missing data.diff() as a bug.
It's not.
Care to elaborate?
--
Ryan May
Graduate Research Assistant
School
a built
in function that will do what you want. However, you would mask that
builtin with the from numpy import *.
Ryan
--
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
___
Numpy-discussion mailing list
Numpy-discussion
= N.ctypeslib.load_library('test1ctypes.so', '.')
or try to get gcc to make a test1ctypes.dylib.
Ryan
--
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http
Charles R Harris wrote:
On Jan 7, 2008 8:47 AM, Ryan May [EMAIL PROTECTED] mailto:[EMAIL
PROTECTED] wrote:
Stuart Brorson wrote:
I realize NumPy != Matlab, but I'd wager that most users would think
that this is the natural behavior..
Well, that behavior won't
the
distribution differently than multiplying the distribution/density
function by a number.
Ryan
--
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http
array will have count elements,
otherwise its
size is determined by the size of string. If sep is not empty then the
string is interpreted in ASCII mode and converted to the desired
number type
using sep as the separator between elements (extra whitespace is
ignored).
Ryan
--
Ryan
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
, but the inconsistency 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
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 Assistant
School of Meteorology
University of Oklahoma
___
Numpy-discussion mailing list
Numpy-discussion
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 been changed in NumPy 1.0.2
to return a 0-d array
101 - 165 of 165 matches
Mail list logo