[Numpy-discussion] Args for ones, zeros, rand, eye, ones, empty (possible 1.0 change?)

Sasha ndarray at mac.com
Mon Jul 3 13:07:00 CDT 2006


On 7/3/06, Alan G Isaac <aisaac at american.edu> wrote:
> ....
> Consistency! That is exactly the issue,
> especially for those who wish to teach with numpy.
>
> I do not want to tell my students to write
> ones([5,5])
> but
> rand(5,5)
> and although relatively new to Python
> I actually like the practice of providing
> dimensions in a list or tuple.
>

Consistency is already lost because 1d case allows both ones(5) and
ones([5]) (and even ones((5,)) if anyone can tolerate that
abomination).  I don't think those who argue for sequence only are
willing to require ones([5]).

Remember, "A Foolish Consistency is the Hobgoblin of Little Minds"
(Ralph Waldo Emerson (1803–1882),  adopted without attribution as a
section heading in PEP 8 <http://www.python.org/dev/peps/pep-0008>).

I think the current situation strikes the right balance between
convenience and consistency.




More information about the Numpy-discussion mailing list