[Numpy-discussion] ANN: NumPy/SciPy Documentation Marathon 2008
Thu May 22 08:33:15 CDT 2008
Stéfan van der Walt wrote:
> It looks like there is significant interest in using "np" instead of
> "numpy" in the examples (i.e. we expect the user to do "import numpy
> as np" before trying code snippets).
> Would anybody who objects to using "np" raise it now, so that we can
> bury this issue?
> 2008/5/22 Rob Hetland <firstname.lastname@example.org>:
>> On May 22, 2008, at 11:37 AM, Pauli Virtanen wrote:
>>> Or should we "assume from numpy import *" or "import numpy as np"? I
>> Although a good case could probably be made for all three (*, np,
>> numpy), I think that if "import numpy as np" is to be put forward as
>> the standard coding style, the examples should use this as well.
>> Rob Hetland, Associate Professor
>> Dept. of Oceanography, Texas A&M University
>> phone: 979-458-0096, fax: 979-845-6331
>> Numpy-discussion mailing list
> Numpy-discussion mailing list
I prefer using 'import numpy' over 'import numpy as np'. But as long as
each example has 'import numpy as np' included then I have no
objections. The main reason for this is that the block of code can
easily be copied and pasted to run a complete entity. Also this type of
implicit assumption often get missed because these assumptions are often
far from the example (missed in web searches) or overlooked as the
reader doesn't think that part was important.
More information about the Numpy-discussion