Well, the title says it all:
嗯,标题说明了一切:
from numpy import linalg as LA
import numpy as np
fortytwo = np.array(42)
LA.norm(42) # works
LA.norm(fortytwo) # works
# All the lines below raise a ValueError:
LA.norm(fortytwo,np.inf)
LA.norm(fortytwo,-np.inf)
LA.norm(fortytwo,1)
LA.norm(42,1)
fro