Skip to content

numpy.fft: Undocumented behavior of s argument #14179

@peterbell10

Description

@peterbell10

Ref: scipy/scipy#10569

The s parameter for nd-fft functions is documented as being a "sequence of ints", however it is also possible to supply None in any of the elements and the corresponding default value is used. e.g.

import numpy as np
x = np.arange(10)
assert np.fft.fftn(x, s=(None,)).shape == 10

This is a consequence of numpy using the 1d fft internally

for ii in itl:
a = function(a, n=s[ii], axis=axes[ii], norm=norm)

Is this behaviour intentional? If so then it doesn't seem to be documented anywhere that I could see.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions