numpy/numpy-import-alias
| Rule | numpy-import-alias |
|---|---|
| Pack | NumPy |
| Severity | info |
| Fix | none, edit by hand |
| Library versions | every version |
NumPy's docs import it as np, and other code and the fixes of this pack expect that name. Write import numpy as np.
import numpy as Nimport numpy as npWhat the rule reports
Section titled “What the rule reports”The rule reports import numpy as <name> with a name other than np or xp, and from numpy import *, which replaces Python's sum, min, max, round, abs, all and any.
How to fix it
Section titled “How to fix it”xpd has no automatic fix. Because every use of the old name changes with the import. Make the change by hand.
Message
Section titled “Message”xpd prints this message with the issue. A name that starts with $ stands for code from your file.
NumPy's docs import it as np, and other code and the fixes of this pack expect that name. Write import numpy as np.Browse the other rules of the NumPy pack.