Should I use numpy (or pylab) as a python environment by using `from numpy import *`?

前端 未结 5 1557
一个人的身影
一个人的身影 2021-01-04 08:32

I use pylab (more specifically numpy) in all of my python programs­. The exceptions are very rare, if any. So far, I have taken the habit of importing numpy in the following

5条回答
  •  轮回少年
    2021-01-04 09:29

    Let's tackle from the other way around, I get your code to debug, and I see that you call:

    zeros(5)
    

    it is tedious to go check around your source to see if this is np.zeros or you redefined it somewhere else, and since pylab has 930 names, this can happen easily.

提交回复
热议问题