On 10/7/2016 9:12 PM, Charles R Harris wrote:
*Always return a float *
/Pluses/
* Computational convenience
Is the behavior of C++11 of any relevance to the choice?
http://www.cplusplus.com/reference/cmath/pow/
Alan Isaac
___
NumPy-Discussion
Is there a numpy equivalent to Mma's CoordinateBounds command?
http://reference.wolfram.com/language/ref/CoordinateBounds.html
Thanks,
Alan Isaac
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
https://mail.scipy.org/mailman/listinfo/
On 8/16/2016 4:06 AM, Ralf Gommers wrote:
The whole enhancement request doesn't look very interesting imho.
Because the functionality is already in NumPy,
or because it is easily user-written?
Alan
___
NumPy-Discussion mailing list
heers,
Alan Isaac
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
https://mail.scipy.org/mailman/listinfo/numpy-discussion
])
if (k not in seen):
result.append(datum)
seen.add(k)
if invert: result.reverse()
return result
Cheers,
Alan Isaac
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
https://mail.scipy.org/mailman/listinfo/numpy
On 6/20/2016 5:59 PM, Nathaniel Smith wrote:
If you have the time to check for existing bug reports about this, and
file a new bug if you don't find one, then it'd be appreciated.
https://github.com/numpy/numpy/issues/7770
Alan
___
NumPy-
ype('int8')
>>> (np.int64(2**7)*np.arange(5,dtype=np.int8)).dtype
dtype('int16')
fwiw,
Alan Isaac
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
https://mail.scipy.org/mailman/listinfo/numpy-discussion
in advance to anyone who can help me understand better
the issues in play.
Cheers,
Alan Isaac
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
https://mail.scipy.org/mailman/listinfo/numpy-discussion
nt8(2)**2)
>>> type(np.uint64(2)**np.int8(2))
I don't think anyone has proposed first principles
from which the desirable behavior could be deduced.
I do think reference to the reasoning used by other
languages in making this decision could be helpful.
have argued a**2 should
produce an int32 when a is an int32: what if a is an int8?
(Obviously the overflow problem is becoming extremely pressing ...)
Thanks,
Alan
PS Where are these casting rules documented?
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
https://mail.scipy.org/mailman/listinfo/numpy-discussion
ats provides a better
match to Python's behavior (i.e., it allows sensible handling of
negative powers). Users who really want in output and understand
overflow should be supported with a function.
Anyway, I've said my piece and will shut up now.
Cheers,
Alan
://wiki.haskell.org/Power_function
http://stackoverflow.com/questions/6400568/exponentiation-in-haskell
Alan
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
https://mail.scipy.org/mailman/listinfo/numpy-discussion
On 6/10/2016 1:20 PM, Ian Henriksen wrote:
forcing float output for people who actually want integers is not at all ideal
Yes, there definitely should be a function supporting this.
Alan
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
ntext.
Is 2**40 a "large power"?
Finally, is np.arange(1,3)**-2 "innocent looking" to a Python user?
Cheers,
Alan
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
https://mail.scipy.org/mailman/listinfo/numpy-discussion
the real question is
whether it is strong enough tosacrifice backwards compatibility.
Hope this summary is of some use and not too tendentious,
Alan
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
https://mail.scipy.org/mailman/listinfo/numpy-discussion
On 5/24/2016 3:57 PM, Eric Moore wrote:
Changing np.arange(10)**3 to have a non-integer dtype seems like a big change.
What about np.arange(100)**5?
Alan Isaac
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
https://mail.scipy.org
inly be used
by beginners.
Alan
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
https://mail.scipy.org/mailman/listinfo/numpy-discussion
?
Having (**) actually work seems worth quite a lot.
Alan Isaac
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
https://mail.scipy.org/mailman/listinfo/numpy-discussion
On 5/24/2016 1:19 PM, Stephan Hoyer wrote:
the int ** 2 example feels quite compelling to me
Yes, but that one case is trivial: a*a
And at least as compelling is not have a**-2 fail
and not being tricked by say np.arange(10)**10.
The latter is a promise of hidden errors.
Alan
("usually") overflow
- a numpy function cd meet specialized exponentiation needs
Thanks,
Alan Isaac
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
https://mail.scipy.org/mailman/listinfo/numpy-discussion
Yes, I was referring to `pow`,
but I had in mind the C++ version,
which is overloaded:
http://www.cplusplus.com/reference/cmath/pow/
Cheers,
Alan
On 5/20/2016 4:27 PM, Warren Weckesser wrote:
C doesn't have an exponentiation operator. The C math library has pow, powf
and powl, which
f the
possible input pairs overflow the type.
My core inclination would be to use (what I understand to be)
the C convention that integer exponentiation always produces
a double, but to support dtype-specific exponentiation with
a function. But this is just a user's perspective.
Cheers,
On 4/8/2016 5:13 PM, Nathaniel Smith wrote:
he doesn't want 2d matrices, he wants
tools that make it easy to work with stacks of 2d matrices stored in
2-or-more-dimensional arrays.
Like `map`?
Alan Isaac
___
NumPy-Discussion mailing list
is a
perceived need ...
Cheers,
Alan Isaac
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
https://mail.scipy.org/mailman/listinfo/numpy-discussion
more keystrokes.
(It's still horribly ugly, though, and I
hope this too is dismissed.)
Alan Isaac
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
https://mail.scipy.org/mailman/listinfo/numpy-discussion
`, would be
the same as `ndarray.transpose(True)`.
Use `dot`. E.g.,
m.dot(a)
hth,
Alan Isaac
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
https://mail.scipy.org/mailman/listinfo/numpy-discussion
such a new function correct the apparent mistake (?) of
`linspace` including the endpoint by default?
Or is the current API justified by its Matlab origins?
(Or have I missed the point altogether?)
If this query is annoying, please ignore it. It is not meant to be.
On 2/17/2016 7:01 PM, Juan Nunez-Iglesias wrote:
Notice the limitation "1D array-like".
http://docs.scipy.org/doc/numpy-1.10.0/reference/generated/numpy.random.choice.html
"If an int, the random sample is generated as if a was np.arange(n)&qu
e.
http://docs.scipy.org/doc/numpy-1.10.0/reference/generated
/numpy.random.choice.html
fwiw,
Alan Isaac
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
https://mail.scipy.org/mailman/listinfo/numpy-discussion
at issue,
not push for a change. I think citing non-existent standards
is not helpful. I think the discrepancy between the Python
standard library and numpy for a function going by a common
name is harmful. (But then, I teach.)
fwiw,
Alan
___
NumPy
about the user interface.
Nobody is proposing changing the behavior of `range`.
That is an entirely separate question.
I'm not trying to change any minds, but let's not rely
on spurious arguments.
Cheers,
Alan
___
NumPy-Discussion mail
On 2/17/2016 11:46 AM, Robert Kern wrote:
some at least are 1-based indexing, so closed intervals do make sense.
Haskell is 0-indexed.
And quite carefully thought out, imo.
Cheers,
Alan
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
posed name (after `randint` deprecation): `randints`.
Cheers,
Alan Isaac
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
https://mail.scipy.org/mailman/listinfo/numpy-discussion
In principle, if we are describing an *interval*, that is
the right thing to do:
https://en.wikipedia.org/wiki/Interval_(mathematics)#Including_or_excluding_endpoints
Alan Isaac
On 1/19/2016 9:21 AM, G Young wrote:
Of the methods defined in *numpy/mtrand.pyx* (excluding helper functions and
On 11/27/2015 5:37 AM, Stephan Sahm wrote:
I like to request a generator/iterator support for np.array(...) as far as
list(...) supports it.
http://docs.scipy.org/doc/numpy/reference/generated/numpy.fromiter.html
hth,
Alan Isaac
___
NumPy
than meant by
"I think this is just a bug in the description of the proposal here, not in the
proposal itself".
So, is the correct phrasing
"the global RandomState object should use the latest implementation of the
methods, unless expli
numpy version number. This will allow everyone
who wants to to change now, without requiring that users attend to minor
numpy version numbers if they want replicability.
I think this is what is required by semantic versioning.
Alan Isaac
On 5/24/2015 4:59 AM, Ralf Gommers wrote:
> the reasoning
at `@` would neither be bound by the behavior of `dot` nor expected to be
reconciled with it.
I agree that where `@` and `dot` differ in behavior, this should be clearly
documented.
I would hope that the behavior of `dot` would not change.
Alan
___
Num
rgument offered.
As for the "logic" of the current behavior, can it not be given a
tensor product motivation? (Otoh, it conflicts with the current
behavior of `vdot`.)
Alan
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http
> Alan wrote:
>> 3. I admit, my students are NOT using non-boolen fancy indexing on
>> >multidimensional arrays. (As far as I know.) Are yours?
On 4/9/2015 2:22 AM, Nathaniel Smith wrote:
> Well, okay, this would explain it, since integer fancy indexing is
> exactly t
On 4/9/2015 1:57 AM, Nathaniel Smith wrote:
> Do you think there's anything we could be
> doing to reduce this kind of adrenaline reaction while still allowing
> for relaxed discussion about out-there ideas?
numpy3...@scipy.org
:-)
___
NumPy-Discussion
non-boolen fancy indexing on
multidimensional arrays. (As far as I know.) Are yours?
Cheers,
Alan
On 4/8/2015 3:05 PM, Eric Firing wrote:
> What sequence of steps might reduce the disconnect between numpy and the
> rest of the array-handling world? And make it a little friendlier for
>
x27;s very reassuring.
fwiw,
Alan
On 4/7/2015 9:06 PM, Nathaniel Smith wrote:
> If a grad student or junior colleague comes to you with an
> idea where you see some potentially critical flaw, do you
> yell THAT WILL NEVER WORK and kick them out of your
> office? Or, do you maybe ask a
which matches the online help:
http://docs.scipy.org/doc/numpy/reference/generated/numpy.random.uniform.html#numpy.random.uniform
Thanks,
Alan Isaac
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion
Today I accidentally wrote `uni = np.random.uniform((-0.5,0.5),201)`,
supply a tuple instead of separate low and high values. This gave
me two draws (from [0..201] I think). My question: how were the
arguments interpreted?
Thanks,
Alan Isaac
the product
unless forced to.)
Cheers,
Alan
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion
Just recalling the one-year-ago discussion:
http://comments.gmane.org/gmane.comp.python.numeric.general/56494
Alan Isaac
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion
nicer NumPy,
I cannot find any way to say MATLAB is "nicer".
Cheers,
Alan
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion
> On Sat, Jan 3, 2015 at 8:05 AM, Alan G Isaac wrote:
>> Would this really be practicality beating purity?
>> It would be nice to have know the principle governing this.
>> For example, is there a way to convincingly group these as
>> array oper
`. Has anyone requested this?
(I can see the argument for `diag`.)
Alan Isaac
On 1/2/2015 9:04 PM, Charles R Harris wrote:
> The diag, diagonal, and ravel functions have recently been changed to
> preserve subtypes. However, this causes lots of backward compatibility
> problems
>
As the question asks:
should `unpackbits` add a dtype argument?
At the moment I'm interest in unpacking as a boolean array.
Alan Isaac
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion
Just wondering why there is no `np.divmod` corresponding
to `ndarray.__divmod__`? (I realize one can just use
`divmod`.) Couldn't the `out` argument be useful?
Thanks,
Alan Isaac
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
graph dimensions.
(These are square to that is inferrable, but
for general binary relations even that is not
true.) I'm wondering how others approach this.
Thanks,
Alan Isaac
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.o
e than never?)
More relevant at this point: it seems very odd
that `packbits` does not *accept* a boolean array,
even if it does not insist upon one. Might this
be considered a bug?
Cheers,
Alan Isaac
___
NumPy-Discussion mailing list
NumPy-Discussi
On 11/13/2014 1:32 PM, Nathaniel Smith wrote:
> I think you're being misled by buggy exception handling weirdness,
> where the ValueError raised by calling __bool__ is getting delayed,
> and then pre-empting the AttributeError that should be generated by
> the call to __nonzero__.
Aha!
Thanks.
_
On 11/13/2014 12:37 PM, Antony Lee wrote:
> On Python3, __nonzero__ is never defined (always raises an AttributeError),
> even after calling __bool__.
The example I posted was Python 3.4.1 with numpy 1.9.0.
fwiw,
Alan Isaac
Python 3.4.1 (v3.4.1:c0e311e010fc, May 18 2014, 10:38:22) [MSC
;> t.__bool__()
True
>>> t.__nonzero__()
ValueError: The truth value of an array with more than one element is
ambiguous. Use a.any() or a.all()
Alan Isaac
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion
On 11/1/2014 3:15 PM, Warren Weckesser wrote:
> I intended the result of `genfromtxt(..., max_rows=n)` to produce the same
> array as produced by `genfromtxt(...)[:n]`.
I find that counterintuitive.
I would first honor skip_header.
Cheers
same cost, why not?
In that case, it is not really useful to speculate about use cases.
If the costs are substantially greater, then that should be stated.
Cost is a good reason not to do something.
fwiw,
Alan Isaac
___
NumPy-Discussion mailing l
say `slice_rows=slice(500)`.
Perhaps you could provide an example illustrating the issues this
reply overlooks.
Cheers,
Alan
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion
e to use".
In particular, `flat` is much more elegant,
and includes an automatic guarantee that the
iterations will be in C-contiguous style.
Alan
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion
iagonal.
(It can be sliced.)
I don't recall the specifics at the moment, but I've been happy to
have it in the past.
Alan Isaac
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion
This is not NumPy specific but may still interest list members:
http://randomascii.wordpress.com/2014/10/09/intel-underestimates-error-bounds-by-1-3-quintillion/
Alan Isaac
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http
that
more versatile than an `nrows` keyword for the number of rows
would be a "rows" keyword for a slice argument.
fwiw,
Alan Isaac
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion
On 9/5/2014 1:19 PM, Neal Becker wrote:
> I think it's somewhat debatable whether generating a different sequence of
> random numbers counts as breaking backward compatibility.
Please: it does.
Alan Isaac
___
NumPy-Discussion mailing
What should be the value of `2**np.int_(-32)`?
It is apparently currently computed as `1. / (2**np.int_(32))`,
so the computation overflows (when a C long is 32 bits).
I would have hoped for it to be computed as `1./(2.**np.int_(32))`.
Cheers,
Alan Isaac
his, can you
please suggest for exploration a language that has adopted
this approach. (Ideally, where the decision is considered a good
one.)
Thank you,
Alan Isaac
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion
uces the mean? And obviously, for any
float data type, the mean value of the values in the array is representable
as a value of the same type.
Alan Isaac
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listin
, then it is a bug.
Alan Isaac
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion
r issues arise for `var` and `std`, etc.
See http://www.johndcook.com/standard_deviation.html
for some discussion and references.
Alan Isaac
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion
downside,
this is only good for 2d, and there have been proposals
for the new array builder to handle other dimensions.
fwiw,
Alan Isaac
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion
r.
(Mathematica considers it an error.)
Alan Isaac
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion
27; to be 3d, or even
'1 2;3 4;;5 6;7 8' (two 2d arrays), but I'm just noting
that, not urging that it be implemented.
Alan Isaac
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion
On 7/5/2014 6:42 PM, Ralf Gommers wrote:
> What next, we give Alan Isaac commit rights and then it's OK to break
> numpy.matrix when that's convenient?
I always wondered what I would do with commit rights ...
Alan
___
NumPy-Discuss
On 4/28/2014 3:29 PM, Neal Becker wrote:
> Well I'd spell it nint, and it works like:
Wouldn't it be simpler to add a dtype argument to `rint`?
Or does that violate the "simple wrapper" intent?
Alan Isaac
___
NumPy-Discus
s seems like an excellent way forward.
There was talk of making this a summer of code project,
but that seems to have sputtered.
Alan Isaac
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion
ing nicely with its absence is even better.)
Thanks,
Alan Isaac
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion
ages (which would suggest using the set operations
instead). In particular, might a[boolean_array] be slower
that a[indexes]? (I'm just asking, not suggesting.)
Thanks!
Alan
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.sc
ero(a<=0).
Can I get them both in one go?
Thanks,
Alan Isaac
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion
)
I somewhat expect the last column to be slowest
as well as least convenient, since it is built to
first convert non-booleans to booleans.
Are there other differences?
Also, is this made clear anywhere in the docs?
Thanks,
Alan Isaac
___
NumPy-Discussion mai
l projects".
http://eigen.tuxfamily.org/index.php?title=Licensing_FAQ
If you are correct in your interpretation, it may be worth
raising the issue and requesting the needed accommodation.
Alan
___
NumPy-Discussion mailing list
NumPy-Dis
On 3/25/2014 5:13 PM, Colin J. Williams wrote:
> avoid the use of an additional operator which would only be used with numpy.
http://legacy.python.org/dev/peps/pep-0465/#but-isn-t-matrix-multiplication-a-pretty-niche-requirement
Alan Isaac
___
Nu
On 3/24/2014 1:41 PM, Charles R Harris wrote:
> For float types you would need to use the negative.
Yes, that's all I could come up with.
So ... shd `sort` have a `reverse` option,
like Python's builtin?
Alan
___
NumPy-Discussion maili
> On Mon, Mar 24, 2014 at 12:08 PM, Alan G Isaac
>> what is the preferred idiom for a descending sort?
On 3/24/2014 12:13 PM, josef.p...@gmail.com wrote:
> adding [::-1] just creates a new view, pretty low cost.
I meant when you need to sort on a key (another vector).
Curren
> On Mon, Mar 24, 2014 at 11:32 AM, Alan G Isaac wrote:
>> I'm wondering if `sort` intentionally does not accept
>> a `key`
>> or if this is just a missing feature?
On 3/24/2014 11:47 AM, Alexander Belopolsky wrote:
> It would be very inefficient to c
I'm wondering if `sort` intentially does not accept a `key`
or if this is just a missing feature? (I suppose that if
the `order` argument is specified it would have to accept
a sequence of keys ...)
Thanks,
Alan Isaac
___
NumPy-Discussion mailing
?
Alan Isaac
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion
with having to use
npla.matrix_power(M,n)
instead of
M@@n
in other teaching settings (e.g., graph theory
and recurrence relations).
I am certainly not objecting to making `@@`
available. It just seems much less important
than getting `@` asap.
Thanks,
Alan Isaac
__
@`.
Questions for `@@`:
- would it just be `matrix_power`, with all the restrictions?
- or would `a(10,2,2)@@-1` return an array of matrix inverses?
- etc
In the end, I'd like to see a functional implementation before
deciding on `@@`, but I would not like to see `@` d
Cheers,
Alan
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion
I have a bincount array `cts`.
I'd like to produce any one array `a` such that `cts==np.bincounts(a)`.
Easy to do in a loop, but does NumPy offer a better (i.e., faster) way?
Thanks,
Alan Isaac
___
NumPy-Discussion mailing list
NumPy-Discu
not have a `first=k` option.
Is such an option worth suggesting?
Thanks,
Alan Isaac
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion
Just got momentarily snagged by not checking the
excellent documentation, which clearly says that
numpy provides the shifted geometric. I'm wondering
why? Who else does? (Not Mathematica, Matlab, Maple,
or Octave.)
Thanks,
Alan Isaac
___
just
asking, is this intentional? (version 1.7.1)
Thanks,
Alan Isaac
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion
g for clarification.) To be
concrete, if `@` is proposed to behave unlike Mathematica's
`Dot` command, I would hope to hear a very clear
mathematical motivation for this. (Specifically, I do not
understand why `@` would do scalar product.)
Otoh, if the proposal is just that `@` should behav
new matrix multiplication operator would not handle
scalar multiplication or violate tensor product rules
(perhaps I am influenced by Mathematica), but I am not
prepared to argue the principles of such choices, and
would appreciate hearing from those who are.
Thanks,
Alan Isaac
On 2/17/2014 8:13 PM, Charles R Harris wrote:
> This is apropos issue #899 <https://github.com/numpy/numpy/issues/899>, where
> it is suggested that power promote integers to float.
Even when base and exponent are both positive integers
e it already knows how to be seen as an ndarray,
the library can always work with m.A when doing any
linear algebra. From what I've read in this thread,
the real issues for scipy seem to lie with the sparse
matrix objects... ?
Alan
___
NumPy-Discus
ted, and a matrix object
already knows how (e.g., m.A). Presumably in
this scenario __asarray__ would return an object
that behaves like an ndarray and a converter for
turning the final result into the desired object
type (e.g., into a `matrix` if necessary).
Hope that clearer, even if it prove
ntee
the core semantics? (And the matrix
object passes this test.) For some objects
we can agree that `asarray` will coerce them.
(E.g., lists.)
I just do not see why scipy should care about
the semantics an object uses for interacting
with other objects of the same type.
Alan Isaac
_
1 - 100 of 957 matches
Mail list logo