Hi,
Looks like I was a little confused. It appears that the nan* versions of
functions in numpy just substitute the NaNs in a copy of the original array
and so are just convenience methods. I was imagining that they were
optimized and handling the NaNs at a lower level. It looks like the
Is there any interest in a nan-ignoring version of einsum a la nansum,
nanprod, etc? Any idea how difficult it would be to implement?
- Chris
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
DEAR PYTHON USERS
DO MATHEMATICAL FUNCTIONS HAVE LIMITATION IN PYTHON in comparison with other
programming languages
I have two mathematical functions:
from scipy.special import sph_jn, sph_jnyn
1) sph_jn (n, z) --- n is float, z is complex number for example: a,b=sph_jn
( 2.0 ,
Happyman bahtiyor_zohidov at mail.ru writes:
[clip]
IF I GIVE ( it is necessary value for my program ):
a , b = sph_jn ( 536 , 2513.2741228718346 + 201.0619298974676j )
The implementation of the spherical Bessel functions is through
this Fortran code:
Thanks Pauli
But I have already very shortly built for bessel function, but the code you
gave me is in Fortran.. I also used f2py but I could not manage to read fortran
codes..that is why I have asked in Python what is wrong??
Пятница, 21 декабря 2012, 12:46 UTC от Pauli Virtanen
Happyman bahtiyor_zohidov at mail.ru writes:
Thanks Pauli But I have already very shortly built for bessel
function, but the code you gave me is in Fortran.. I also used
f2py but I could not manage to read fortran codes..that is why
I have asked in Python what is wrong??
That Fortran code is
I have everything in C or Fortran...According to my friends recommendations I
started learning Python for my research...
Do you mean the functions which gave Nan result has not been developed properly
yet in Python, Don't you
For about 1.5 months I have been facing the same problem for
On 12/21/2012 02:30 PM, Happyman wrote:
I have everything in C or Fortran...According to my friends
recommendations I started learning Python for my research...
Do you mean the functions which gave Nan result has not been developed
properly yet in Python, Don't you
The way most of NumPy
Dag Sverre Seljebotn d.s.seljebotn at astro.uio.no writes:
[clip]
Do you have an implemention of the Bessel functions that work as you
wish in C or Fortran? If so, that could be wrapped and called from Python.
For spherical Bessel functions it's possible to also use the relation
to Bessel
Received from Pauli Virtanen on Fri, Dec 21, 2012 at 08:59:02AM EST:
Dag Sverre Seljebotn d.s.seljebotn at astro.uio.no writes:
[clip]
Do you have an implemention of the Bessel functions that work as you
wish in C or Fortran? If so, that could be wrapped and called from Python.
For
I think you advised about the code which is the same appearance.
==
Problem is not here Sir
I will give you exactly what I was talking about. I have ready codes already(It
would be kind of you if you checked the
Hi,
Your code tries to to evaluate
z = 1263309.3633394379 + 101064.74910119522j
jv(536, z)
# - (inf+inf*j)
In reality, this number is not infinite, but
jv(536, z) == -2.3955170861527422e+43888 + 9.6910119847300024e+43887
These numbers (~ 10^43888) are too large for the
Thanks
But I could find for Win64 bit windows
Second question: Did you mean that I have to put lens limits of those
number???
Пятница, 21 декабря 2012, 15:45 UTC от Pauli Virtanen p...@iki.fi:
Hi,
Your code tries to to evaluate
z = 1263309.3633394379 + 101064.74910119522j
I'm having some trouble using the linalg.lstsq() function with certain data
and trying to understand why. It's always returning nans when I feed it
this numpy array of float64 data:
data = df.close.values #coming from a pandas dataframe
type(data)
numpy.ndarray
data.dtype
dtype('float64')
data
Larry Paltrow larry.paltrow at gmail.com writes:
I'm having some trouble using the linalg.lstsq() function
with certain data and trying to understand why. It's
always returning nans when I feed it this numpy array of float64 data:
data = df.close.values #coming from a pandas dataframe
np.isnan(data) is True
False
On Mon, Oct 29, 2012 at 1:50 AM, Pauli Virtanen p...@iki.fi wrote:
Larry Paltrow larry.paltrow at gmail.com writes:
I'm having some trouble using the linalg.lstsq() function
with certain data and trying to understand why. It's
always returning nans when I
Hi,
On Mon, Oct 29, 2012 at 11:01 AM, Larry Paltrow larry.palt...@gmail.comwrote:
np.isnan(data) is True
False
Check with:
np.all(~np.isnan(x))
My 2 cents,
-eat
On Mon, Oct 29, 2012 at 1:50 AM, Pauli Virtanen p...@iki.fi wrote:
Larry Paltrow larry.paltrow at gmail.com writes:
I'm
Ok thanks, I figured np.isnan(data) is True is what we want but wasn't
certain. I think it should describe the same thing.
np.all(~np.isnan(data))
False
Seems to be all non-nan
On Mon, Oct 29, 2012 at 2:12 AM, eat e.antero.ta...@gmail.com wrote:
Hi,
On Mon, Oct 29, 2012 at 11:01 AM, Larry
Larry Paltrow larry.paltrow at gmail.com writes:
[clip]
np.all(~np.isnan(data))
False
Seems to be all non-nan
No, it means you have NaNs in your data.
--
Pauli Virtanen
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
doh! thanks
On Mon, Oct 29, 2012 at 2:36 AM, Pauli Virtanen p...@iki.fi wrote:
Larry Paltrow larry.paltrow at gmail.com writes:
[clip]
np.all(~np.isnan(data))
False
Seems to be all non-nan
No, it means you have NaNs in your data.
--
Pauli Virtanen
Hi,
this is probably my lack of understanding...when i set up some masks for 2
arrays and try to divide one by the other I get a runtime warning. Seemingly
this is when I am asking python to divide one nan by the other, however I
thought by masking the array numpy would then know to ignore these
Hi,I was wondering if it is possible to process (in if statement - check if the given value is NaN) numpy NaN value inside the weave.inline c code.testcode = '''if (test(0)) { return_val = test(0);}'''err = weave.inline(testcode,['test'], type_converters = converters.blitz,
On Fri, Jan 14, 2011 at 12:03 PM, Joon Ro joonp...@gmail.com wrote:
Hi,
I was wondering if it is possible to process (in if statement - check if the
given value is NaN) numpy NaN value inside the weave.inline c code.
testcode = '''
if (test(0)) {
return_val = test(0);
}
'''
err =
Oops .. I guess isnan() inside the weave code just works fine. Should have tried this first.By the way, is there any speed lost doing this? Should I convert all NaN values into a integer and use it inside the weave inline c code?-JoonOn Fri, 14 Jan 2011 14:03:16 -0600, Joon Ro joonp...@gmail.com
2009/4/20 Wes McKinney wesmck...@gmail.com:
I assume that, because NaN != NaN, even though both have the same hash value
(hash(NaN) == -32768), that Python treats any NaN double as a distinct key
in a dictionary.
In [76]: a = np.repeat(nan, 10)
In [77]: d = {}
In [78]: for i, v in
josef.p...@gmail.com wrote:
2009/4/20 Wes McKinney wesmck...@gmail.com:
I assume that, because NaN != NaN, even though both have the same hash value
(hash(NaN) == -32768), that Python treats any NaN double as a distinct key
in a dictionary.
In [76]: a = np.repeat(nan, 10)
In [77]: d =
I assume that, because NaN != NaN, even though both have the same hash value
(hash(NaN) == -32768), that Python treats any NaN double as a distinct key
in a dictionary.
In [76]: a = np.repeat(nan, 10)
In [77]: d = {}
In [78]: for i, v in enumerate(a):
: d[v] = i
:
:
In
On Mon, Apr 20, 2009 at 11:42 PM, Wes McKinney wesmck...@gmail.com wrote:
I assume that, because NaN != NaN, even though both have the same hash value
(hash(NaN) == -32768), that Python treats any NaN double as a distinct key
in a dictionary.
I think that strictly speaking, nan should not be
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)
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
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 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 =
Hello,
I switched from numarray to numpy and I have now some NaN
in my matrix. What that means ?
None a numeric ?
regards
Jean-Luc REGNIER
ACR Mimarlik Ltd. Sti
Savas Cad. 26/B Sirinyali
ANTALYA, TURKEY
Tel. Fax: 0090-(0).242.316.08.09
GSM: 0090-0.532.303.36.21
Hi,
I am developing some numpy code, which sometimes fail because of
nan. This is likely to be due to some bad coding on my side, and as such
any NaN is a bug for this particular piece of code.
Is there a way to get a warning when the first Nan is detected in
the code (or even a faulty
David Cournapeau wrote:
Hi,
I am developing some numpy code, which sometimes fail because of
nan. This is likely to be due to some bad coding on my side, and as such
any NaN is a bug for this particular piece of code.
Is there a way to get a warning when the first Nan is detected
On 2/27/07, Robert Kern [EMAIL PROTECTED] wrote:
David Cournapeau wrote:
Hi,
I am developing some numpy code, which sometimes fail because of
nan. This is likely to be due to some bad coding on my side, and as such
any NaN is a bug for this particular piece of code.
Is there a
Keith Goodman kwgoodman at gmail.com writes:
matrix([[ 0.94425407, 0.02216611, 0.999475 ],
[ 0.40444129, nan, 0.23264341],
[ 0.24202372, 0.05344269, 0.37967564]])
x.max()
0.379675636032 Wrong (for me)
x[1,1] = 0
x.max()
0.999474999444 -
On Friday 01 December 2006 17:56, Keith Goodman wrote:
...
Would it break anything to change the first line of the nan functions from
a = array(a)
to
a = asanyarray(a)
?
Seeing what the nan functions do, I don't think that would be a problem. An
expception would be raised if the operation
43 matches
Mail list logo