Hi All,
I've added ufuncs fmin and fmax that behave as follows:
In [3]: a = array([NAN, 0, NAN, 1])
In [4]: b = array([0, NAN, NAN, 0])
In [5]: fmax(a,b)
Out[5]: array([ 0., 0., NaN, 1.])
In [6]: fmin(a,b)
Out[6]: array([ 0., 0., NaN, 0.])
In [7]: fmax.reduce(a)
Out[7]: 1.0
In
Hi Charles,
2008/10/2 Charles R Harris [EMAIL PROTECTED]:
In [3]: a = array([NAN, 0, NAN, 1])
In [4]: b = array([0, NAN, NAN, 0])
In [5]: fmax(a,b)
Out[5]: array([ 0., 0., NaN, 1.])
In [6]: fmin(a,b)
Out[6]: array([ 0., 0., NaN, 0.])
These are great, many thanks!
My only
On Thu, Oct 2, 2008 at 02:37, Stéfan van der Walt [EMAIL PROTECTED] wrote:
Hi Charles,
2008/10/2 Charles R Harris [EMAIL PROTECTED]:
In [3]: a = array([NAN, 0, NAN, 1])
In [4]: b = array([0, NAN, NAN, 0])
In [5]: fmax(a,b)
Out[5]: array([ 0., 0., NaN, 1.])
In [6]: fmin(a,b)
Hi all,
how can I load ASCII data if the file contains characters
instead of floats
Traceback (most recent call last):
File test_csv.py, line 2, in module
A = loadtxt('ca6_sets.csv',dtype=char ,delimiter=';')
NameError: name 'char' is not defined
Nils
2008/10/2 Robert Kern [EMAIL PROTECTED]:
My only gripe is that they have the same NaN-handling as amin and
friends, which I consider to be broken.
No, these follow well-defined C99 semantics of the fmin() and fmax()
functions in libm. If exactly one of the arguments is a NaN, the
non-NaN
On Thu, Oct 2, 2008 at 4:37 PM, Stéfan van der Walt [EMAIL PROTECTED] wrote:
These are great, many thanks!
My only gripe is that they have the same NaN-handling as amin and
friends, which I consider to be broken. Others also mentioned that
this should be changed, and I think David C wrote a
A Thursday 02 October 2008, John Gu escrigué:
Hello,
I am using numpy in conjunction with pyTables. The data that I read
in from pyTables seem to have the following dtype:
p = hdf5.root.myTable.read()
p.__class__
type 'numpy.ndarray'
p[0].__class__
type 'numpy.void'
p.dtype
A Thursday 02 October 2008, Nils Wagner escrigué:
Hi all,
how can I load ASCII data if the file contains characters
instead of floats
Traceback (most recent call last):
File test_csv.py, line 2, in module
A = loadtxt('ca6_sets.csv',dtype=char ,delimiter=';')
NameError: name 'char'
On Thu, Oct 2, 2008 at 11:41 AM, Charles R Harris
[EMAIL PROTECTED] wrote:
Which is rather clever. I think binary_cast will require some pointer abuse.
Yep (the funny thing is that the bit twiddling will likely end up more
readable than this C++ stuff)
cheers,
David
2008/10/2 Francesc Alted [EMAIL PROTECTED]:
how can I load ASCII data if the file contains characters
instead of floats
You would need to specify the length of your strings. Try with
dtype=SN, where N is the expected length of the strings.
Other options include:
- using converters to
Stéfan van der Walt [EMAIL PROTECTED] writes:
Let me rephrase: I'm not convinced that these C99 semantics provide
an optimal user experience. It worries me greatly that NaN's pop
up in operations and then disappear again. It is entirely possible
for a script to run without failure and
On Thu, Oct 2, 2008 at 1:42 AM, Robert Kern [EMAIL PROTECTED] wrote:
On Thu, Oct 2, 2008 at 02:37, Stéfan van der Walt [EMAIL PROTECTED]
wrote:
Hi Charles,
2008/10/2 Charles R Harris [EMAIL PROTECTED]:
In [3]: a = array([NAN, 0, NAN, 1])
In [4]: b = array([0, NAN, NAN, 0])
In [5]:
Charles R Harris wrote:
Yes. If there is any agreement on this I would like to go ahead and do
it. It does change the current behavior of maximum and minimum.
If you do it, please do it with as many tests as possible (it should not
be difficult to have a comprehensive test with *all* float
On Thu, Oct 2, 2008 at 2:41 AM, David Cournapeau [EMAIL PROTECTED] wrote:
On Thu, Oct 2, 2008 at 11:41 AM, Charles R Harris
[EMAIL PROTECTED] wrote:
Which is rather clever. I think binary_cast will require some pointer
abuse.
Yep (the funny thing is that the bit twiddling will likely
Frank,
How about that:
x = np.loadtxt('file')
z = x.sum(1) # Reduce data to an array of 0,1,2
rz = z[z0] # Remove all 0s since you don't want to count those.
loc = np.where(rz==2)[0] # The location of the (1,1)s
count = np.diff(loc) - 1 # The spacing between those (1,1)s, ie, the
Frank,
I would imagine that you cannot get a much better performance in python
than this, which avoids string conversions:
c = []
count = 0
for line in open('foo'):
if line == '1 1\n':
c.append(count)
count = 0
else:
if '1' in line: count += 1
One could do some
Thans David and Chris for providing the nice solution.
Both method works gread. I could not tell the speed difference between the two
solutions. My data size is 1048577 lines.
I did not try the second solution from Chris since it is too slow as Chris
stated.
Frank
Date: Thu, 2 Oct 2008
Hey Steve,
I'll bring my camera and try to recruit a volunteer. No guarantees,
but we should at least be able to record things (any volunteers to
transcode a pile of scipy videos? ;-) ).
Best,
Travis
On Oct 1, 2008, at 7:56 PM, Steve Lianoglou wrote:
Hi,
Are there any plans to tape
On Thu, Oct 2, 2008 at 08:22, Charles R Harris
[EMAIL PROTECTED] wrote:
On Thu, Oct 2, 2008 at 1:42 AM, Robert Kern [EMAIL PROTECTED] wrote:
On Thu, Oct 2, 2008 at 02:37, Stéfan van der Walt [EMAIL PROTECTED]
wrote:
Hi Charles,
2008/10/2 Charles R Harris [EMAIL PROTECTED]:
In [3]: a =
I also like the idea of a scipy.spatial library. For the research I
do in machine learning and computer vision we are often interested in
specifying different distance measures. It would be nice to have a
way to specify the distance measure. I would like to see a standard
set included:
2008/10/2 David Bolme [EMAIL PROTECTED]:
I also like the idea of a scipy.spatial library. For the research I
do in machine learning and computer vision we are often interested in
specifying different distance measures. It would be nice to have a
way to specify the distance measure. I would
To all,
I have now been able to develop a stable file via f2py!! However, I had
to execute the following:
1.) First, I had to copy all required library files from my selected
Compaq visual Fortran compiler under python's scripts directory along
with f2py itself.
2.) I also had to include
Jarrod Millman wrote:
The 1.2.0rc2 is now available:
http://svn.scipy.org/svn/numpy/tags/1.2.0rc2
what's the status of this?
Here are the Window's binaries:
http://www.ar.media.kyoto-u.ac.jp/members/david/archives/numpy/numpy-1.2.0rc2-win32-superpack-python2.5.exe
this appears to be a dead
On Thu, Oct 2, 2008 at 16:45, Chris Barker [EMAIL PROTECTED] wrote:
Jarrod Millman wrote:
The 1.2.0rc2 is now available:
http://svn.scipy.org/svn/numpy/tags/1.2.0rc2
what's the status of this?
Superceded by the 1.2.0 release. See the thread ANN: NumPy 1.2.0.
Here are the Window's binaries:
It may be useful to have an interface that handles both cases:
similarity and dissimilarity. Often I have seen Nearest Neighbor
algorithms that look for maximum similarity instead of minimum
distance. In my field (biometrics) we often deal with very
specialized distance or similarity
Robert Kern wrote:
Superceded by the 1.2.0 release. See the thread ANN: NumPy 1.2.0.
I thought I'd seen that, but when I went to:
http://www.scipy.org/Download
And I still got 1.1
Superceded by
2008/10/2 David Bolme [EMAIL PROTECTED]:
It may be useful to have an interface that handles both cases:
similarity and dissimilarity. Often I have seen Nearest Neighbor
algorithms that look for maximum similarity instead of minimum
distance. In my field (biometrics) we often deal with very
see http://scipy.org/scipy/numpy/ticket/921
I think I found the error
http://scipy.org/scipy/numpy/browser/trunk/numpy/random/mtrand/distributions.c
{{{
805 /* this is a correction to HRUA* by Ivan Frohne in rv.py */
806 if (good bad) Z = m - Z;
}}}
Quickly looking at the
On Thu, Oct 2, 2008 at 4:29 PM, Chris Barker [EMAIL PROTECTED] wrote:
Robert Kern wrote:
Superceded by the 1.2.0 release. See the thread ANN: NumPy 1.2.0.
I thought I'd seen that, but when I went to:
http://www.scipy.org/Download
And I still got 1.1
I updated the page to point to the
Filed as http://scipy.org/scipy/numpy/ticket/923
and I think i finally tracked down the source of the incorrect random
numbers, a reversed inequality in
http://scipy.org/scipy/numpy/browser/trunk/numpy/random/mtrand/distributions.c
line 871, see my last comment to the trac ticket.
Josef
On Sep
30 matches
Mail list logo