Skip to main content

Scientific Python tools use rising in education

It's pretty clear to me that Python is rapidly growing in acceptance as a computational platform at universities everywhere. I recently heard from Josh Bloom at UC Berkeley astronomy that his proposal for a short 'boot camp' course at the beginning of the Fall semester was approved. This is excellent news, last year I taught something similar for neuroscience students and postdocs, and I'm glad to see the campus adopting python further as a key component of the computational training the science students receive.



John Hunter and I just completed a few days ago teaching another such workshop at the Claremont Colleges, supported by an NSF grant that John Milton, (J. Hunter's PhD advisor) has for exposing undergraduates to a number of research-related experiences. This grant supports summer research internships where two undergrads visit together a research lab away from their home campus to work independently on a project, as well as our teaching of scientific python tools (we were also there in 2008 and hopefully will continue next year).

I have to say that I really enjoy teaching this type of workshop, especially now that the core tools are fairly mature, installation isn't the problem it used to be, and we have a chance of presenting interesting examples to the students from the very beginning. By now we've taught a number of these at various labs and universities, and I think we've found a good workflow.  John is a phenomenal lecturer, with a real knack for illustrating interesting concepts on the fly, in a very natural manner that is honestly similar to how exploratory work is actually done in real research, where you run a bit of code, plot some results, print a few things, code some more, etc. In the picture above, he was working through some of the matplotlib image tutorial, which gave us an opportunity to find and fix a small bug in how the luminance histogram was being computed (the current form is correct). Every one of these students probably has a digital camera these days (if nothing else, in a cell phone), so an example like this is a great way to connect something they are used to with mathematical and programming concepts.



Here, John gave a great illustration of random numbers and simple statistics. He built up interactively a simulation of random walks, working up from a single (one-dimensional) walker to a group of them, comparing the simulation results with the analytical predictions for various quantities (like mean and variance), and also explaining to the students how these squiggly lines could be considered a model of price fluctuations over time. In this manner, he connected the somewhat abstract statistical concepts to something the students could relate to, namely the risk of an investment making a profit or a loss after a certain period.

We also talked about FFTs, dynamical systems, error analysis, data formats, and a few other things. It was very encouraging to have most of the students return on the second day, considering how this was a completely optional activity for them, covering an entire weekend (with morning lectures both days) right before they had to start diving into their finals. But they were a smart and enthusiastic bunch, and I hope that the workshop gave them some useful starting points they can then develop on their own as they get involved in research projects.

These are just two examples of how we are now seeing Python's acceptance in university computing growing. We have a lot of work still ahead of us, but it's really encouraging to see how far we've come from the days when building scipy was a black art, IPython was little more than a different prompt for the python shell and matplotlib could only do basic line plots in a GTK window. We now have tools that provide a complete computational environment for teaching and research, and things are only getting better...

Comments

hfv said…
This are great news indeed! Just a few weeks ago the school I work for in Guatemala decided that next January they'll start walking the pythonic path, leaving Java behind. All the engineering instructors are required to take a python workshop (getting some of them to use python-based tools might be the hardest challenge). So, thank you for all your great work!
Fernando Perez said…
@hfv
That's great to hear! I'll actually be spending all of February teaching a whole-month course on Python for computational physics at the Universidad de Antioquia in Medellin, Colombia (where I obtained my undergraduate degree). I'll try to post some updates on that here as well.
Unknown said…
We are trying to do a similar thing at the University of Wisconsin-Madison in January. If you or John or Josh would like to take part in any way, let us know :-) We would be happy to have you.
http://python.hackerwithin.org
Fernando Perez said…
@matthew
Can you contact me by email so we can talk about this? Fernando.Perez@Berkeley.edu

Thanks!
Unknown said…
(FOR ENGLISH SPEAKERS: SORRY FOR THIS SPANISH MESSAGE)

Reciba un cordial saludo Prof. Fernando Perez,

Mi nombre es William Oquendo. Soy miembro del grupo de investigacion Simulacion de Sistemas Fisicos de la Universidad Nacional de Colombia ( www .ssf.unal.edu.co ). Nuestro trabajo consiste en estudiar sistemas complejos, que van desde medios granulares hasta la magnetohidrodinamica de sol pasando por trafico vehicular, microfluidica, fracturamiento, etc. Normalmente disenhamos e implementamos nuestros programas en C++, y realizamos el analisis posteriormente. En cuanto a visualizacion usamos herramientas como povray, gnuplot y xmgrace, es decir cosas muy sencillas.

Estamos muy interesados en aprender nuevas herramientas que nos permitan indagar mejor en las soluciones que obtenemos, atacar problemas mas complejos y ser mas productivos. Por eso el interes nuestro en lenguajes y herramientas como Python, Mayavi2, VTK, etc.

Hemos observado que usted vendra a Colombia en el 2010, a la UDEA, a dictar un seminario sobre Python en computacion cientifica. Me gustaria saber si usted estara en Bogota algun tiempo y si seria posible invitarlo a dictarnos alguna conferencia, curso o similar. Seria un honor para nosotros compartir con un experto como usted. Como no conozco realmente su disponibilidad y requerimientos, le solicito respetuosamente que me indique las posibilidades que tenemos, el tiempo, posibles costos, recursos computacioneles, etc. Podria coordinar este evento en la Universidad Nacional o en la Universidad de los Andes, dado que estamos vinculados a un centro de excelencia en investigacion que agrupa a ambas universidades.

Agradezco mucho su amable atencion y le deseo una feliz Navidad y un prospero anho nuevo 2010.

Cordialmente,


--
William Oquendo
Simulation Of Physical Systems Group
Unknown said…
Wow, new useful tools in education are always welcome, especially if they particularly help with speed and getting things done neatly.

Travacor

Popular posts from this blog

Blogging with the IPython notebook

Update (May 2014): Please note that these instructions are outdated. while it is still possible (and in fact easier) to blog with the Notebook, the exact process has changed now that IPython has an official conversion framework. However, Blogger isn't the ideal platform for that (though it can be made to work). If you are interested in using the Notebook as a tool for technical blogging, I recommend looking at Jake van der Plas' Pelican support or Damián Avila's support in Nikola . Update: made full github repo for blog-as-notebooks, and updated instructions on how to more easily configure everything and use the newest nbconvert for a more streamlined workflow. Since the notebook was introduced with IPython 0.12 , it has proved to be very popular, and we are seeing great adoption of the tool and the underlying file format in research and education. One persistent question we've had since the beginning (even prior to its official release) was whether it would...

The IPython notebook: a historical retrospective

On December 21 2011, we released IPython 0.12 after an intense 4 1/2 months of development.  Along with a number of new features and bug fixes, the main highlight of this release is our new browser-based interactive notebook : an environment that retains all the features of the familiar console-based IPython but provides a cell-based execution workflow and can contain not only code but any element a modern browser can display.  This means you can create interactive computational documents that contain explanatory text (including LaTeX equations rendered in-browser via MathJax), results of computations, figures, video and more.  These documents are stored in a version-control-friendly JSON format that is easy to export as a pure Python script, reStructuredText, LaTeX or HTML. For the IPython project this was a major milestone, as we had wanted for years to have such a system, and it has generated a fair amount of interest online. In particular, on our mailing list a us...

An ambitious experiment in Data Science takes off: a biased, Open Source view from Berkeley

Today, during a White House OSTP event combining government, academia and industry, the Gordon and Betty Moore Foundation and the Alfred P. Sloan Foundation announced a $37.8M funding commitment to build new data science environments. This caps a year's worth of hard work for us at Berkeley, and even more for the Moore and Sloan teams, led by Vicki Chandler , Chris Mentzel and Josh Greenberg : they ran a very thorough selection process to choose three universities to participate in this effort. The Berkeley team was led by Saul Perlmutter , and we are now thrilled to join forces with teams at the University of Washington and NYU, respectively led by Ed Lazowska and Yann LeCun . We have worked very hard on this in private, so it's great to finally be able to publicly discuss what this ambitious effort is all about. Most of the UC Berkeley BIDS team, from left to right: Josh Bloom, Cathryn Carson, Jas Sekhon, Saul Perlmutter, Erik Mitchell, Kimmen Sjölander, Jim Sethia...