9 ms·
Introduction to Python for Computational Science and Engineering [pdf]
- mynegation 10y agoThis is a very good guide. I thought I knew python ecosystem well and I found something new for myself ('visual' package for 3D illustrations). I am wondering if there are guides for the "reverse direction": I already know how to program, but I want to learn new scientific domain that is interesting to me: e.g. material science, climate modeling, etc. Something like Rosalind[1] does for bioinformatics. [1] http://rosalind.info/ http://rosalind.info/
- godelski 10y agoWell if you want to learn the science, you can just pick up a science book. I know many users here have good suggestions. But if you are specifically looking for scientific computing those generally talk about code basics. There are also numeric programming books. If you're trying to get into those studies I suggest going through a numerics book because the techniques will be similar among any of the code. But you'll have to spend time learning the non-coding parts as well. In science coding is just a tool.
- water42 10y agoWoah, Rosalind looks awesome- like project euler for bioinformatics. Thanks for sharing the link.
- sjnair96 10y agoThanks for sharing Rosalind! If you (or anyone else) knows similar projects in bioinformatics or any other fields, do let me know!
- dschiptsov 10y agoPython3 as default dialect!
- dschiptsov 10y agoWhat exactly is wrong with this particular comment?)
- anc84 10y agoIt does not contribute anything meaningful to the discussion on the submitted link.
- dschiptsov 10y agoIt does. It emphasizes that this particular guide encourages use of Python3, instead of holding onto legacy, which means that the author understands programming languages basics or at lest knows which semantic unification has been done to make the language less inconsistent, hence more beautiful.
- drej 10y ago> As Python 2.x is still the default Python on many system and there are a fair number of research codes out there based on Python 2, we will use Python 2.x in this book. This is so unfortunate. Scientific computing is riddled with technical debt and starting with Python 2 today is fairly irresponsible. If you're already invested in Python 2 and have code/training written up, fine. But if you're learning it just now, as the book's audience obviously is, picking Python 3 should be a no brainer.
- danso 10y agoI'm a hardcore proponent of Python 3 (because it's the only Python I've ever used/learned), but I'm OK with this book accepting the realities and for at least committing to writing 3.x compatible code: > However, we will write code that is as much as possible in the Python 3 style (and understood by Python 2). The most prominent example is that in Python 2.x, the print command is special where as in Python 3 it is an ordinary function. I don't specialize in the purported domain of this book, but if the author thinks that `print` will be the most prominent differentiator, then I'm guessing that there aren't a ton of situations where it'll be hard to make his examples 3.x compatible (for this domain, I'm assuming behavior of the division operator will be another prominent, but easy-to-fix difference).
- _coldfire 10y agoReduce is easy to fix also, but that ignores the entire reasoning for it being removed and only serves to highlight the massive chasm between 2 and 3. The clean break of 3 and the sanity it brings to the language is undeniable.
- I_deny_it 10y ago> The clean break of 3 and the sanity it brings to the language is undeniable. Well, I can't deny they broke it, but sanity is pretty deniable. Python has always been a dynamic language, and one of the core mantras was "there should be one obvious way to do it" (in contrast to Perl). All the new type annotation stuff and the multiple ways to handle string formatting are steps in very weird directions. Maybe they should make a Python version 4 to clean some of that mess up.
- Normal_gaussian 10y agoI'm dubious about the worth of this book as I lived with several soton Engineering students as they went through the associated course (whilst I did CS as part of the other 'Engineering' faculty, ECS), though a lot may have been due to lack of engagement with this particular course (copying and memorisation were sufficient to get you through it). I was always so frustrated that my friends couldn't benefit from some of the great lecturers in my own faculty. That said I know a few Engineering students there now who are awesome programmers (though Aero Engineers at heart, so I can't hire them :( ).
- a3n 10y agoI'm very sympathetic to "use python2." I still use python2. But we should all keep in mind the "no shit really this time" EOL for python is 2020. http://legacy.python.org/dev/peps/pep-0373/ http://legacy.python.org/dev/peps/pep-0373/ Even if you say "well, it'll just be forked," you don't really know how many forks and pain there will be. Maybe python2 will be like LibreOffice, or maybe it will be like OpenOffice. Like it or not, python3 is the future.
- module0000 10y agoAnd the bucket of people who want python2 forked weighed against the bucket of people can can fork/maintain it are not equal.
- toomuchstuff 10y agoITT: Narcissism of small differences https://en.wikipedia.org/wiki/Narcissism_of_small_differences https://en.wikipedia.org/wiki/Narcissism_of_small_difference... If the authors of a textbook made the decision to use 2.7, it's good enough for anyone.
- embleton 10y agoI just finished working through this book and I really enjoyed it. I went from next to no Python knowledge to writing programs to analyze raw vibration data in a few days. I had previous experience with Matlab and this book was very useful in bridging the gap between the two systems.
- truthordie 10y agoThat's great. Have you been writing vectorized code in Python then?
- fangohr 10y agoHi all, I am the author of the book. There is a Python 3 version of the book available at http://www.southampton.ac.uk/~fangohr/teaching/python/book.html http://www.southampton.ac.uk/~fangohr/teaching/python/book.h... This also includes Jupyter Notebook files for those who want to execute (and play around with) the chapter content interactively. Thank you for all the comments and discussion. Hans (fangohr@soton.ac.uk)
- stared 10y agoIt looks wonderful! Just yesterday I did a quick workshop introducing neuroscience to scientific Python, in the Jupyter Notebook environment (very rough version here: https://github.com/stared/python-neuroaspects-2016 https://github.com/stared/python-neuroaspects-2016, before updates). I will definitely sent the participants a link to your book. But one small question: do you plan, by any chance, upload your notebooks to GitHub (or any other place, where one can easily see a rendered version; BTW one more selling point of Jupyter - the easiness to share)?
- fangohr 10y agoThank you. It is on my todo list.
- fangohr 10y agoJust found a page dedicated to Python 3 for scientists: https://python-3-for-scientists.readthedocs.io/en/latest/ https://python-3-for-scientists.readthedocs.io/en/latest/ Also an impressive line up of scientific tools that will drop Python 2 support by 2020: http://www.python3statement.org http://www.python3statement.org (And for completeness: the book discussed in this thread is available for Python 3 at http://www.southampton.ac.uk/~fangohr/teaching/python/book.html http://www.southampton.ac.uk/~fangohr/teaching/python/book.h... )