Python in Hydrology

Categories:

Recommended

Why Python?

Python is a simple and powerful programming language. By simple I mean, that it is much more forgiving than languages like C though slow also. By powerful, I mean it can glue many existing code which were written in C, C++, Fortran etc. easily. This has a growing user community which makes many tools easily available. Python Package Index which is a major host of the Python code, has more than 15,000 packages listed, which speaks about it popularity. Use of Python in hydrology community is not so fast as compared to other field, but now a days many new hydrological packages are being developed. Python provides access to a nice combination of GIS tools, Mathematics, Statistics etc., which make it a useful language for the hydrologist. Following are the major advantages of Python for the hydrologist:

1. A clear and readable syntax.

2. Modules can be easily written in C, and C++.

3. It can be used on all major platforms (Windows, Linux/Unix, Mac etc.)

4. Easy to learn.

5. And it is free.

1.2 Python Installation

Usually all the Linux/Unix system has Python by-default. If it is not there, or for non-linux/unix users, the basic version of Python can be downloaded by following the instructions provided below. The basic Python version includes minimal packages required to run the python, and some other additional packages. For most of the hydrological applications, these packages are not enough, and we require additional packages. In the next section, I will be describing how to install additional packages. Throughout the book, the chevron (>>>) represents the Python shell, and $ represents the Unix/Linux shell or window’s command line. The installation of Python for the various operating system is done in the following way.

Category:

Attribution

Sat Kumar Tomer. Python in Hydrology. http://www.greenteapress.com/pythonhydro/pythonhydro.html

VP Flipbook Maker

Convert your work to digital flipbook with VP Online Flipbook Maker! You can also create a new one with the tool. Try it now!