> I was playing with this though and was a little surprised to find
> NumPy allows things like this:
>
> >>> a = np.array([1, 2, 3])
> >>> a[:] = np.array([[[5, 6, 7]]])
> >>> a
> array([5, 6, 7])
Thanks Aaron for this example! I hadn't seen this before, and indeed
the suggested PR doesn't interce
@george trojan
The SciPy devs are very careful not to break backwards compatibility,
even if the changes are arguably useful. That's why the impact of the
numpy PR remains under the hood for SciPy users.
I'd love to see SciPy become more consistent with array
dimensionality, too, but that's a diff
To Andrew Nelson:
> In the return section for fsolve the documentation states that the return
> value, `x`, is an `ndarray`.
True, my bad. There is another issue with `fsolve`: it implicitly changes
the argument passed to `func`. Consider
def func(x):
# x = float(x)
if not np.isscalar(x
Presumably this also changes int(), bool(), and complex() in the same way.
The array API standard (and numpy.array_api) only requires float(),
bool(), and int() (and soon complex()) for dimension 0 arrays (the
standard does not have scalars), in part because of this NumPy issue
https://data-apis.o
On Thu, 16 Sep 2021, 03:25 george trojan, wrote:
>
> I just wrote the following code:
>
> twb = scipy.optimize.fsolve(phi, tdb, args=(tdb, p, w, hd_tdb, hg_tdb),
> xtol=1e-8)
> tdb, p, w, hd_tdb, hg_tdb
> twb.shape
> print("wet-bulb temperature {:.5f} [deg K]".format(float(twb)))
>
> The output i
On Wed, 2021-09-15 at 17:25 +, george trojan wrote:
> Responding to the post by nico.schloe...@gmail.com (I subscribe to
> the
> digest).
>
> I just wrote the following code:
>
> twb = scipy.optimize.fsolve(phi, tdb, args=(tdb, p, w, hd_tdb,
> hg_tdb),
> xtol=1e-8)
> tdb, p, w, hd_tdb, hg_tdb
Hello Nico,
Any step in the direction of consistency and type safety is a good one to me.
I’m +1 on this change.
Best regards,
Hameer Abbasi
> Am 15.09.2021 um 14:18 schrieb Nico Schlömer :
>
> Hi everyone,
>
> This is seeking input on PR [1] which I've worked on with @eric-wieser
> and @sebe
On Wed, Sep 15, 2021 at 5:18 AM Nico Schlömer
wrote:
> Hi everyone,
>
> This is seeking input on PR [1] which I've worked on with @eric-wieser
> and @seberg. It deprecates
> ```
> float(x)
> ```
> if `x` is an array of ndim > 0. (It works with all arrays of size 1
> right now.) This aligns the be
Responding to the post by nico.schloe...@gmail.com (I subscribe to the
digest).
I just wrote the following code:
twb = scipy.optimize.fsolve(phi, tdb, args=(tdb, p, w, hd_tdb, hg_tdb),
xtol=1e-8)
tdb, p, w, hd_tdb, hg_tdb
twb.shape
print("wet-bulb temperature {:.5f} [deg K]".format(float(twb)))
Hi everyone,
This is seeking input on PR [1] which I've worked on with @eric-wieser
and @seberg. It deprecates
```
float(x)
```
if `x` is an array of ndim > 0. (It works with all arrays of size 1
right now.) This aligns the behavior of float() on ndarrays with
float() on lists which already fails
10 matches
Mail list logo