Python for Civil Engineers

Venkat
3 min readNov 3, 2018

--

Image credits: Unsplash

One of my friends invited to me Pycon India 2018 Conference held in Hyderabad. He is a Software Engineer and working with Python since last five years.

I have asked him that why I should attend this conference because I am a civil engineer and I don’t have any coding experience. He suggested me that every engineering field is turning towards data science and automation so better attend to get an idea about how the programming is changing the world.

I realized that my friend’s words are right after attending the conference Pycon India 2018. There were a lot of inspiring talks all around. From text automation to flood prediction. All presented by students, tech giants, and entrepreneurs. Though I don’t have any prior experience in data science and automation, I felt it was great.

Keynote speaker was the founder of Flask Armin Ronacher, he compared the most popular programming languages of 2018 Python, Rust and explained how the python community could improve its efficiency further.

Another Keynote speaker, founder of Anaconda Travis Oliphant shared his experience developing Anaconda and python packages.

After all these inspiring talks I started to think about python.

Python implementation was started in December 1989 by Guido van Rossum. Python drew inspiration from other programming languages like C, C++, Java, Perl, and Lisp. It’s accessible, and user-friendly syntax made python more popular. When I am going through its syntax, methods, functions, and classes, I felt whether I am reading the code or a letter, that much flexible syntax python has.

For example, the code below the sum of even numbers from 1 to 100 written in python.

def sum_even(a, b):
count = 0
for i in range(a, b, 1):
if(i % 2 == 0):
count += i
return count

Python looks like same as Tim Peters guiding principles for Python’s design 19 aphorisms.

Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
The complex is better than complicated.
The flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren’t special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one — and preferably only one — obvious way to do it.
Although that way may not be obvious at first unless you’re Dutch.
Now is better than never.
Although never is often better than *right* now.
If the implementation is hard to explain, it’s a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea — let’s do more of those!

How is it useful for Civil Engineers?

Like many fields of engineering, Civil engineering also involve data science applications. Python is the most popular programming language in data science.

Following are the applications of data science in civil engineering:

  1. Population forecasting for urban planning, water supply & sewerage system.
  2. Risk assessment and mitigation such as prediction of floods, earthquakes, cyclones.
  3. Predicting traffic trends in Highway engineering.

4. Soil simulation and modeling in Geotechnical engineering.

5. Finite element applications in Structural engineering.

6. Construction management.

7. ML (Machine Learning) applications such as automation in structural design and drawings.

Why python why not another programming languages?

As per Stack overflow Most Loved, Dreaded, and Wanted Languages are

Above statistics clearly shows that currently, python is the most wanted programming language and will remain top for the next decade as it is often updating its libraries with open source ecosystem.

The 21st-century world is changing dynamically. AI & ML, dominate all engineering disciplines and more in Civil engineering.

We should be ready for the next big challenge automation in the Civil engineering industry.

Change is inevitable. Change is constant. -Benjamin Disraeli

--

--

Venkat

Engineer cum writer| I believe that writing is not only a hobby, but it’s also therapy.