r/IPython • • Jul 03 '13

Crash Course in Python for Scientists

Edit: Here's the link

I've pulled together some notes from a course I taught 15 years ago to a group of scientists, and have updated them as an IPython notebook. I'd welcome any feedback you have on what is effective or not effective in these notes.

19 Upvotes

21 comments sorted by

View all comments

2

u/Patorogo Jul 03 '13

Nice! I'm always on the lookout for this kind of tutorials as I'm a scientist who uses Python and likes to proselytize it.

I've only given it a quick look, but I would like to suggest 2 things. First, I think it's worth mentioning optional arguments in the Overview (as they are widely use). Second, when parsing files, I think it's better to use (and teach) the functions and modules already developed, like the csv module or the loadtxt function from numpy; easier and faster.

One last thing, is it possible to add an index to an IPython notebook? That would be great.

3

u/Orphion Jul 03 '13

Thanks for the feedback!

2

u/westurner Jul 04 '13

1

u/Orphion Jul 05 '13

I'll see whether I can figure out an index. Thanks!

1

u/westurner Jul 05 '13

Thank you! There are plenty of jQuery table of contents plugins that could be added to IPython notebook (viewer), but I don't know how stable the #fragment-identifier links would be. the most worthwhile approach would probablybbe auto-slugifying text content of the header tags as #url-fragment-identifiers... Just starting at #0 or #1 would hardly be permalinks if/when additional headers/sections are added.

2

u/Orphion Jul 05 '13

As you can probably tell from what I've written, I'm very reluctant to add an additional dependency. I work with chemists and physicists, and each additional dependency I require typically reduces my audience by 25-50%. But I'll see what I can do nonetheless.

1

u/NomadNella Jul 05 '13

After a little experimentation I found that by using

<h2><a href="#quick-referance-text"></a>Quick Referance Text</h2>

in a markdown cell, not only does it look like,

Quick Referance Text

but when you look at the notebook posted on the nbviewer site you can simply add "/#other-thoughts" to the end of the url and it will jump to that header. See the example below.

http://nbviewer.ipython.org/5937269/#quick-referance-text

This approach would require you to enter the base url into the notebook after it was posted, but you could build a table of contents or index list into the notebook. It's probably a little more work but you won't need any additional dependencies.

2

u/Orphion Jul 06 '13

Thanks. I'll make note of this for the next rewrite.