[Numpy-discussion] Functions vs Methods
gael.varoquaux at normalesup.org
Wed Dec 28 01:55:48 EST 2011
On Wed, Dec 28, 2011 at 12:09:45PM +0530, Jaidev Deshpande wrote:
> Eg. x is a NumPy array, and I need its transpose
> Should I use
> >>> x.T
> >>> numpy.transpose(T) ?
If you are wondering for a timing reason, use IPython's '%timeit' magic
to figure out if it does make a difference or not.
In general, I tend to prefer 'x.T', which I find more readable.
More information about the NumPy-Discussion