Skip to main content Accessibility help
×
Hostname: page-component-cd9895bd7-fscjk Total loading time: 0 Render date: 2024-12-22T20:12:26.661Z Has data issue: false hasContentIssue false

Part III - Python codes

Published online by Cambridge University Press:  05 June 2012

Herman J. C. Berendsen
Affiliation:
Rijksuniversiteit Groningen, The Netherlands
Get access

Summary

This appendix contains programs, functions or code fragments written in Python. Each code is referred to in the text; the page where the reference is made is given in the header.

First some general instructions are given on how to work with these codes. Python is a general-purpose interpretative language, for which interpreters are available for most platforms, including Windows. Python is in the public domain and interpreters are freely available. Most applications in this book use a powerful numerical array extension NumPy, which also provides basic tools in linear algebra, Fourier transforms and random numbers. Although Python version 3 is available, at the time of writing NumPy requires Python version 2, the latest being 2.6. In addition, applications may require the scientific tools library SciPy, which relies on NumPy. Importing SciPy automatically implies the import of NumPy.

Users are advised first to download Python 2.6, then the most recent stable version of NumPy, and then SciPy. Further instructions for Windows users can be found at www.hjcb.nl/python.

There are several options to produce plots, for example Gnuplot.py, based on the gnuplot package or rpy based on the statistical package “R.” But there are many more. Since the user may find it difficult to make a choice, we have added yet another, but very simple to use, plotting module called plotsvg.py. It can be downloaded from the author's website.

Type
Chapter
Information
Publisher: Cambridge University Press
Print publication year: 2011

Access options

Get access to the full version of this content by using one of the access options below. (Log in options will check for institutional or personal access. Content may require purchase if you do not have access.)

Save book to Kindle

To save this book to your Kindle, first ensure [email protected] is added to your Approved Personal Document E-mail List under your Personal Document Settings on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part of your Kindle email address below. Find out more about saving to your Kindle.

Note you can select to save to either the @free.kindle.com or @kindle.com variations. ‘@free.kindle.com’ emails are free but can only be saved to your device when it is connected to wi-fi. ‘@kindle.com’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.

Find out more about the Kindle Personal Document Service.

  • Python codes
  • Herman J. C. Berendsen, Rijksuniversiteit Groningen, The Netherlands
  • Book: A Student's Guide to Data and Error Analysis
  • Online publication: 05 June 2012
  • Chapter DOI: https://doi.org/10.1017/CBO9780511921247.021
Available formats
×

Save book to Dropbox

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Dropbox.

  • Python codes
  • Herman J. C. Berendsen, Rijksuniversiteit Groningen, The Netherlands
  • Book: A Student's Guide to Data and Error Analysis
  • Online publication: 05 June 2012
  • Chapter DOI: https://doi.org/10.1017/CBO9780511921247.021
Available formats
×

Save book to Google Drive

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Google Drive.

  • Python codes
  • Herman J. C. Berendsen, Rijksuniversiteit Groningen, The Netherlands
  • Book: A Student's Guide to Data and Error Analysis
  • Online publication: 05 June 2012
  • Chapter DOI: https://doi.org/10.1017/CBO9780511921247.021
Available formats
×