[Numpy-discussion] Allow for callable in indexing

2021-11-24 Thread cameron . pinnegar
If you have an array built up out of method chaining, sometimes you need to 
filter it at the very end. This can be annoying because it means you have to 
create a temporary variable just so you can refer to it in the indexing square 
brackets:

_temp = long_and_complicated_expression()
result = _temp[_temp >= 0]

You could also use the walrus operator but this is odd looking and it still 
pollutes the namespace:

result = (_temp := long_and_complicated_expression())[_temp >= 0]

What I would like is to be able to use a lambda inside the indexing square 
brackets, which would take the whole array as an argument and give a boolean 
array:

result = long_and_complicated_expression()[lambda arr: arr >= 0]

I should emphasize, the lambda gets the entire array as its argument, and 
returns an entire mask array of bools. It isn't like the `map` and `filter` 
builtins where it would call the python function once for each element and thus 
be slow.

Pandas already has something similar[1]; you can pass a lambda into `.loc[]` 
that takes a Series and returns a boolean indexer.

[1] 
https://pandas.pydata.org/pandas-docs/version/0.18.1/whatsnew.html#method-chaininng-improvements
___
NumPy-Discussion mailing list -- numpy-discussion@python.org
To unsubscribe send an email to numpy-discussion-le...@python.org
https://mail.python.org/mailman3/lists/numpy-discussion.python.org/
Member address: arch...@mail-archive.com


[Numpy-discussion] ANN: SciPy 1.7.3

2021-11-24 Thread Tyler Reddy
Hi all,

On behalf of the SciPy development team, I'm pleased to announced the
release of SciPy 1.7.3,
which is a bug fix release that includes wheels for MacOS 12+ arm64 at
Python versions 3.8, 3.9, and 3.10.

Sources and binary wheels can be found at:
https://pypi.org/project/scipy/
and at: https://github.com/scipy/scipy/releases/tag/v1.7.3



One of a few ways to install this release with pip:

pip install scipy==1.7.3

=
SciPy 1.7.3 Release Notes
=

SciPy 1.7.3 is a bug-fix release that provides binary wheels
for MacOS arm64 with Python 3.8, 3.9, and 3.10. The MacOS arm64 wheels
are only available for MacOS version 12.0 and greater, as explained
in Issue 14688, linked below.

Authors
==

* Anirudh Dagar
* Ralf Gommers
* Tyler Reddy
* Pamphile Roy
* Olivier Grisel
* Isuru Fernando

A total of 6 people contributed to this release.
People with a "+" by their names contributed a patch for the first time.
This list of names is automatically generated, and may not be fully
complete.

Issues closed for 1.7.3
---

* `#13364 `__: Segmentation
fault on import of scipy.integrate on Apple M1 ARM...
* `#14688 `__: BUG: ARPACK's
eigsh & OpenBLAS from Apple Silicon M1 (arm64)...
* `#14991 `__: four CI
failures on pre-release job
* `#15077 `__: Remaining test
failures for macOS arm64 wheel
* `#15081 `__: BUG:
Segmentation fault caused by scipy.stats.qmc.qmc.update_discrepancy


Pull requests for 1.7.3
--

* `#14990 `__: BLD: update
pyproject.toml for Python 3.10 changes
* `#15086 `__: BUG: out of
bounds indexing in stats.qmc.update_discrepancy
* `#15090 `__: MAINT: skip a few
failing tests in \`1.7.x\` for macOS arm64

Checksums
=

MD5
~~~

65166885666a1a74deffe429d093e6f2
 scipy-1.7.3-cp310-cp310-macosx_10_9_x86_64.whl
537752d6744b507f203f376ec2df6e70
 scipy-1.7.3-cp310-cp310-macosx_12_0_arm64.whl
e518125fc38cedde00da54672655b7cd
 scipy-1.7.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
c83ba57d18c24e3e0f899378f6bc0876
 scipy-1.7.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
ba90233a59aaf0f05485de296bea6fc1  scipy-1.7.3-cp310-cp310-win_amd64.whl
ce3ca8d9bb3ace6686b89e07f767a013
 scipy-1.7.3-cp37-cp37m-macosx_10_9_x86_64.whl
16ce33be314dae61c953c5c6e605cba6
 scipy-1.7.3-cp37-cp37m-manylinux_2_12_i686.manylinux2010_i686.whl
83f8b25f1a00a5e37eca4e1463d046fa
 scipy-1.7.3-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
44254582f51de14fd15d8be44a309a8b
 scipy-1.7.3-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
af219af017f220f217e6308cad5893e1  scipy-1.7.3-cp37-cp37m-win32.whl
29b476d691e325c924b2cf77d0ff8b99  scipy-1.7.3-cp37-cp37m-win_amd64.whl
6341d96c9f9edfd7221708636d6dab5c
 scipy-1.7.3-cp38-cp38-macosx_10_9_x86_64.whl
919b3f6c4b5f9cc137b2e40c50837ba7
 scipy-1.7.3-cp38-cp38-macosx_12_0_arm64.whl
697cb8e337a8073792aca67aa4dd7f49
 scipy-1.7.3-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.whl
e1c1c129731f8623f7168153f6088472
 scipy-1.7.3-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
6203426ffb92a0a12606eaa885d74d54
 scipy-1.7.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
936de7e1b6c4f05079ac2ea4e63d0436  scipy-1.7.3-cp38-cp38-win32.whl
9da686cd27c2e51342deb1d2d060fa08  scipy-1.7.3-cp38-cp38-win_amd64.whl
cf4e152fb2e7241e7bdd7761191590ae
 scipy-1.7.3-cp39-cp39-macosx_10_9_x86_64.whl
97f2f1ee23139230063ff07ce4e9c61b
 scipy-1.7.3-cp39-cp39-macosx_12_0_arm64.whl
df508267071a08b63f21b8ae3dcd5eb2
 scipy-1.7.3-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.whl
391662df3e0411daa08b5421e54ad9c0
 scipy-1.7.3-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
0587d18e903b1ceaeb6bab73f704872d
 scipy-1.7.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
3a0b4991b3a994fb6e0bbcc9c99ab5c9  scipy-1.7.3-cp39-cp39-win32.whl
4e168ff30d040edbaac53efb43d8cda4  scipy-1.7.3-cp39-cp39-win_amd64.whl
daae4fedcd479738e54fd7035445be89  scipy-1.7.3.tar.gz
9e6a6ae20e68e99031229c430f966672  scipy-1.7.3.tar.xz
1a9ceac2a40fef71b75859040e371906  scipy-1.7.3.zip

SHA256
~~

173308efba2270dcd61cd45a30dfded6ec0085b4b6eb33b5eb11ab443005e088
 scipy-1.7.3-cp310-cp310-macosx_10_9_x86_64.whl
21b66200cf44b1c3e86495e3a436fc7a26608f92b8d43d344457c54f1c024cbc
 scipy-1.7.3-cp310-cp310-macosx_12_0_arm64.whl
ceebc3c4f6a109777c0053dfa0282fddb8893eddfb0d598574acfb734a926168
 scipy-1.7.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
f7eaea089345a35130bc9a39b89ec1ff69c208efa97b3f8b25ea5d4c41d88094
 s