Skip to main content

Python Hydrology


Recently I'm learning Python and encountered the Hydrology book. Had to upgrade some of python packages and some libraries needed to get working with the book. There is an instruction though about mostly using pip install packages need for the book. The problem is I can't get it work. It's missing some things so I did a little google and hopefully this is a compilation of the things I need to work with the examples of the book.

First off, I updated the apt-get

$ sudo apt-get update

Next is I installed the pip package manager. I'm not too sure but I have Ubuntu 10 and it doesn't have the pip installed. So I installed using the command below.

$ sudo apt-get install python-pip

Now the development packages for python.

$ sudo apt-get install python-dev

Most of the examples uses the scientific number packages so I installed numpy and other packages I'm not quite aware of. It's just that some of the examples probably in the later part of the book uses the other two packages aside from numpy.

$ sudo pip install numpy
$ sudo pip install xlrd
$ sudo pip install xlwt

Scipy needs some compilation and I think it has some packages built on top of fortran and some C++ source so I instlaled the essential and fortran packages with the commands.

$ sudo apt-get install libatlas-base-dev gfortran
$ sudo apt-get install build-essential

After installing these prerequisites, install the scipy with the command below.

$ sudo pip install scipy

For some plotting, installing the plot library is useful. There are also lots of examples using the plot.

$ sudo apt-get install python-matplotlib

This one I found the most useful package. It can be used as good reference to execute plotting some equations. At the very first stage of the book I encountered simple plotting of an array of x with the sin(x) as y coordinates and it's really helpful to visualize the equations with the plotter.

Comments

  1. Hi,
    It seems to me that you have written about my book, 'Python in Hydrology'. First of all thank you for finding the book useful. I will try to update these issues in the next version of book. If there is any question or comment, feel free to write to me.

    ReplyDelete
  2. Really sorry for the late reply. I have forgotten about this article and lately I've trying to write some rough articles about cryptocurrency. Yes it was a fine book. I love python and your book was too advanced for me. I'll try to relearn those things and apply it to some of my fun project(s) now that I only work as a part-timer. Thank you so much again for taking the time to comment. Best of luck my friend! Take care alwasy!

    ReplyDelete

Post a Comment

Popular posts from this blog

Add Brave Browser to Netbeans

We'll I'm liking Brave now, great isn't it. With the token and all and privacy and stuff. And all the good stuff, right? So what other good thing we can do about it other than adding it to our favorite editor. So here it is, adding it is through Tools->Options->General Edit Web Browser Manager and add this setting below. Find the brave.exe usually it can be found in C:\Program Files (x86)\BraveSoftware\Brave-Browser\Application\brave.exe and voila we're good. See you next posts everyone!

Monero is your friendly neighbor - no not really, I mean friendly CPU miner

Monero is another one of those crypto currency that was really big news in 2017. Now the year ends and hoping for a fresh start in 2018. Just got my masternode up and so far so good. X11 is the algo chosen by Sucre so it's not really friendly to CPU. Now, back to Monero. Its algorithm is Cryptonite and it's friendly to miners that only has CPU. First off, get your monero wallet here . As for me, I do use FreeWallet so I don't worry other app/web for every wallet that I have. Anyway, if you get your monero wallet address, that's OK. All we have to do is to find pool to mine. I use MineXMR as it's simpler. You can choose whatever you like, just search for "monero mining pools" and you get bunch to choose from. Get the miner here, extract it to your location of choice and edit the config.json file. {     "algo": "cryptonight",  // cryptonight (default) or cryptonight-lite     "av": 0,                // algorithm var...

Windows 10 HP Netbook Sucks, Lubuntufies it, Great!

I purchased a small netbook from HP few years back and it was installed with Windows 10 Home Edition. I tried it at the shop and works fine until I arrived at home and installed office suites, and some basic programming  tools like Chrome, Python, Visual Studio Code that it became useless. Now it lags and my daughter can't even work with office suites. It was for her, it was a gift, it's suppose to work and not bother her. And now it becomes a pain for her doing research and Google Chrome always says "Not Responding". I just remembered it was 2 years ago. The netbook was just kept at the closet, intended never to see the light again. I was cleaning my small office at home and I found it, I remembered the pain. I remembered it all like yesterday. It was horrible, I cried and asked God, why did I remember all those miseries. Seriously, I just found it, that's it, and just thought, well I think I can have a use for it for a small server at home. Then it hits me, it...