Skip to content

Commit

Permalink
DOC: Change 'num' to 'np'
Browse files Browse the repository at this point in the history
Stumbled upon this *NumPy for Matlab users* guide. Even though it says *Note: this is just an example, not a statement of "best practices"* I think it would still be better to use `np` instead of `num`, as this is the most common abbreviation you'll find in examples etc.

Just close the PR if you disagree.
  • Loading branch information
prisae committed Dec 12, 2018
1 parent b40321f commit f7f8c52
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions doc/source/user/numpy-for-matlab-users.rst
Original file line number Diff line number Diff line change
Expand Up @@ -693,19 +693,19 @@ this is just an example, not a statement of "best practices"):

::

# Make all numpy available via shorter 'num' prefix
import numpy as num
# Make all numpy available via shorter 'np' prefix
import numpy as np
# Make all matlib functions accessible at the top level via M.func()
import numpy.matlib as M
# Make some matlib functions accessible directly at the top level via, e.g. rand(3,3)
from numpy.matlib import rand,zeros,ones,empty,eye
# Define a Hermitian function
def hermitian(A, **kwargs):
return num.transpose(A,**kwargs).conj()
return np.transpose(A,**kwargs).conj()
# Make some shortcuts for transpose,hermitian:
# num.transpose(A) --> T(A)
# np.transpose(A) --> T(A)
# hermitian(A) --> H(A)
T = num.transpose
T = np.transpose
H = hermitian

Links
Expand Down

0 comments on commit f7f8c52

Please sign in to comment.