4 ms·
from matplotlib import pyplot as plt WTF? Broken from right there. What's a plt? "o" key broken? Why didn't they just call it pyplot? Why not just import
by dheera 3y ago
from matplotlib import pyplot as plt
WTF? Broken from right there. What's a plt? "o" key broken? Why didn't they just call it pyplot? Why not just
import pyplot
pyplot.plot(lambda x: math.sin(x))
pyplot.plot(x=[0,1,2],y=[0,2,4])
- krapht 3y agoPeople who are making plots in the terminal don't want to type out the fully qualified library name. Majority of plots are written and read only once during data exploration and analysis time.
- deleted 3y ago[deleted]
- stargazer-3 3y agoThe library is not forcing you to use plt as a shorthand. Nothing is stopping you from calling from matplotlib import pyplot pyplot.plot([0,1,2], [0,2,4])
- dheera 3y agoYeah I know. It's just that they've created an ecosystem of "plt" and that makes me want to use the entire library less.
- Izkata 3y agoIt's a convention of the math-heavy python libraries, numpy and pandas also often get imported as np and pd.