Confusion between numpy, scipy, matplotlib and pylab

前端 未结 3 1882
执念已碎
执念已碎 2020-12-22 15:34

Numpy, scipy, matplotlib, and pylab are common terms among they who use python for scientific computation.

I just learn a bit about pylab, and I got confused. Whenev

3条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-22 15:51

    1. No, pylab is part of matplotlib (in matplotlib.pylab) and tries to give you a MatLab like environment. matplotlib has a number of dependencies, among them numpy which it imports under the common alias np. scipy is not a dependency of matplotlib.

    2. If you run ipython --pylab an automatic import will put all symbols from matplotlib.pylab into global scope. Like you wrote numpy gets imported under the np alias. Symbols from matplotlib are available under the mpl alias.

提交回复
热议问题