I more or less agree that having np and plt magically available can be confusing. That is why I like the spyder template approach. It is super easy to have every new script that you create automatically start with
import matplotlib.pyplot as plt import numpy as np or whatever you want. Is there anything like a user configurable template for ipython notebooks? There seem to be many answers on stackexchange or wherever talking about how people use to do the automatic importing for IPython before Jupyter. Is this functionality that has been deliberately removed? Thanks, Ryan On Monday, August 22, 2016 at 11:43:06 AM UTC-4, Doug Blank wrote: > > On Monday, August 22, 2016 at 10:08:20 AM UTC-4, Ryan Krauss wrote: >> >> I am having a hard time getting a good answer to what I think is a simple >> question. I want my students to try the jupyter notebook and I think we >> will pretty much always need these 3 lines at the start of every notebook >> file: >> >> %matplotlib inline >> import matplotlib.pyplot as plt >> import numpy as np >> >> What is the easiest way to prevent them from having to re-type those >> lines every time? Keep in mind that many of my students will be learning >> python from scratch as we start my class. >> > > Perhaps having these loaded automatically is not the right approach. I > appreciate that those three lines have nothing to do with what you want to > teach. But magically having "np" and "plt" available without doing anything > can also be confusing, especially if the students move to a different > environment, or if you want to share your materials with others that have a > standard environment. > > I would reconsider, and perhaps just import those when you need them. Or, > create a standard way of loading them (maybe a standard magic, or create > your own). Maybe you want to create your own python module around > matplotlib, to make it even easier? > > -Doug > > >> >> Thanks, >> >> Ryan >> > -- You received this message because you are subscribed to the Google Groups "Project Jupyter" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jupyter/47619cad-b230-4cbd-a95f-9a2f8b59e63a%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
