Paul F. Dubois
Mon, 31 Jan 2000 08:06:30 -0800
Your suggestion is not acceptable to me. I understand your reasoning but do
not agree with it.
I question seriously whether Numerical should have any support for
non-numeric types, actually. It causes serious complications for very little
real gain. There is an array object in the core that might suit your needs.
Also, the Python list type will do what you want perfectly well: [None] * n.
If you have an application where n is so large that storage is an issue it
would be surprising. And no, I don't accept the proposition that storage is
always an issue.
If you are only filling up "some" of the entries, it is clear you aren't
subsequently doing arithmetic on the arrays.
From: firstname.lastname@example.org [mailto:email@example.com]On
Behalf Of Greg Kochanski
Sent: Monday, January 31, 2000 7:50 AM
Subject: [Matrix-SIG] Zeros
Speaking of redefining Numeric.zeros(),
I've had the need to create an array
of Nones, then fill up some of the entries.
It would be reasonably nice if Numeric.zeros(size, Numeric.PyObject)
produced an array of Nones, rather than the current
behavior of producing an array of integer zero python objects.
After all, a 'zero' PyObject isn't well defined:
you could want a string ('0'), an int (0), a float (0.0),
or a complex (0+0j). How is the poor package supposed to
read your mind? Better if it produces an array of Nones.
Often, one intends Numeric.zeros() to make an 'empty' array,
and an array of Nones is as empty as one can get.
Matrix-SIG maillist - Matrix-SIG@python.org