PR #16999: https://github.com/numpy/numpy/pull/16999
this PR adds the two 1D Chebyshev transform functions `chebyfft` and
`ichebyfft` into the `numpy.fft` module, utilizing the real FFTs `rfft` and
`irfft`, respectively. As far as I understand, `pockefft` does not support
cosine transforms natively; for this reason, an even extension of the input
vector is constructed, whose real FFT corresponds to a cosine transform.
The motivation behind these two additions is the ability to quickly perform
direct and inverse Chebyshev transforms with `numpy`, without the need to
write scripts that do the necessary (although minor) modifications.
Chebyshev transforms are used often e.g. in the spectral integration of PDE
problems; thus, I believe having them implemented in `numpy` would be useful
to many people in the community.
I'm happy to get comments/feedback on this feature, and on whether it's
something more people would be interested in. Also, I'm not entirely sure
what part of this functionality is/isn't present in `scipy`, so that the two
`fft` modules remain consistent with one another.
Sent from: http://numpy-discussion.10968.n7.nabble.com/
In one of the previous weekly zoom meetings, it was suggested
to ping the mailing list about an updated PR that implements
the `permuted` method for the Generator class in numpy.random.
The relevant issue is
and the PR is
The new method (as it would be called from Python) is
permuted(x, axis=None, out=None)
The CircleCI rendering of the docstring from the pull request is
The new method is an alternative to the existing `shuffle` and
`permutation` methods. It handles the `axis` parameter similar
to how the sort methods do, i.e. when `axis` is given, the slices
along the axis are shuffled independently. This new documentation
(added as part of the pull request) explains the API of the various
Additional feedback on the implementation of `permuted` in the
pull request is welcome. Further discussion of the API should
be held in the issue gh-5173 (but please familiarize yourself
with the discussion of the API in gh-5173--there has already
been quite a long discussion of several different APIs).
There will be a NumPy Community meeting Wednesday Agust 5th at 1pm
Pacific Time (20:00 UTC). Everyone is invited and encouraged to
join in and edit the work-in-progress meeting topics and notes at:
We got an invitation to participate in AI Code-In (
https://aicode-in.github.io/AICode-In/). It's a new initiative, seems a bit
GSoC like, but created by and for middle/high schoolers. We'd have to
create tasks to work on (more like tagging/creation actionable issues than
a full project), and provide some mentoring bandwidth.
It seems well-organized and because it's a new initiative it may be smaller
and more "early adopter" than GSoC. Would anyone be interested to
participate as a mentor and/or lead the NumPy organization participation?
Dear numpy devs and interested readers,
as a day-to-day user, it occurred to me that having a quick look into the contents and extents of arrays is well doable with
numpy. numpy offers a rich set of methods for this. However, very often I oversee myself and others that one just wants to see
if the values of an array have a certain min/max or mean or how wide the range of values are.
I hence sat down to write a summary function that returns a string of hand-packed summary statistics for a quick inspection. I
propose to include it into numpy and would love to have your feedback on this idea before I submit a PR. Here is the core
>>> a = np.random.normal(size=20)
min 25perc mean stdev median 75perc max
-2.289870 -2.265757 -0.083213 1.115033 -0.162885 -2.217532 1.639802
>>> a = np.reshape(a, newshape=(4,5))
min 25perc mean stdev median 75perc max
0 -0.976279 -0.974090 0.293003 1.009383 0.466814 -0.969712 1.519695
1 -0.468854 -0.467739 0.184139 0.649378 -0.036762 -0.465510 1.303144
2 -2.289870 -2.276455 -0.324450 1.230031 -0.289008 -2.249625 1.111107
3 -1.782239 -1.777304 -0.485546 1.259598 -1.236190 -1.767434 1.639802
So you see, it is merely a tiny helper function that can aid practitioners and data scientists to get a quick insight on what an
first off, here is the code:
I put it there as I am not sure at this point, if the community would appreciate such a function or not. Judging from the tests,
lib/utils.py appears to a be place for undocumented functions. So to resolve this and prepare a proper PR, please let me know
where this summary function could reside!
Second, please give me your thoughts on the summary function's output? Should the number of digits be configurable? Should the
columns be configurable? Is is ok to honor the axis parameter which is found in so many numpy functions?
Last but not least, let me stress that this is my first time contribution to numpy. I love the library and would like to
contribute something back. So bear with me, if my code violates best practices in your community for now. I'll bite my teeth
into the formalities of a github PR once I get support from the community and the core devs.
I think that a summary function would be a valuable addition to numpy!