Interview with Kalebu Jordan: Diving Into Python 3

forLoop Tanzania
Dive Into Python 3
Published in
6 min readJun 5, 2020
Thanks to Karim Aazzouzi for sharing their work on Unsplash.

Some weeks ago, we @forLoopTanzania began a journey; one that explores what it takes for anyone without a Python background to #diveintopython3 and become a Pythonista.

This interview was moderated by Gezward Gerald.

Table of Contents

  1. About Kalebu Jordan
  2. Python First Impressions
  3. Python in a Nutshell
  4. The Pretty Pickle
  5. Special Picks

Transcript

Oswald Gerald: Welcome Kalebu.

Kalebu Jordan: Thank you for having me, guys. I am really excited to be here.

About Kalebu Jordan

Oswald Gerald: Kalebu, for everyone that is seeing you for the first time, please share with us what it is you do, and one fun fact about you.

Kalebu Jordan: Once again, I am Kalebu Jordan. A 3rd-year student at Mbeya University studying Mechatronics Engineering. I am super passionate about all things tech, and I really love Python.

One fun fact about me, I am always serious.

Oswald Gerald: Ahh, I love your fun fact, man. It reminds of the Joker movie — why so serious?

Kalebu Jordan: Ha! One of my favorite movies, actually.

Python First Impressions

Oswald Gerald: My next question is simple and I believe, one that most entry-level Python developers will appreciate hearing about — how did you first come across Python?

Kalebu Jordan: Ex Machina — I will have to say, after watching the movie Ex Machina, all hell broke loose. What the movie did is, it helped me spark an obsession with machine learning and artificial intelligence. After the movie, all I wanted to do was, build my own robot.

My early obsession led me to find out that I needed to learn Python to kick-start my robot building dream. After learning the basics of Python, it did not take long for me to dive head-first into machine learning. Fast forward to today, my love for code has changed from C++ to Python, and I am currently exploring web scraping, and building machine learning models with PyTorch.

For anyone in the room interested in tips and tutorials, whenever possible, I blog about all things Python and machine learning at kalebujordan.com.

Oswald Gerald: Wow. I have to admit, that’s quite an inspiring story, man. That you can just grow a career by watching a movie — to me, that is just mind-blowing. Thank you for all that, Kalebu.

Python in a Nutshell

Oswald Gerald: I am certain that our audience has a good understanding of what is Python and what is not Python. However, I am keen to hear from you, what Python is? Why the name, and, why should one use Python?

Kalebu Jordan: Python is a big snake, ha-ha. It just so happens that Guido Van Rossum (creator) has a pretty good sense of humor.

Ok, Python is a high-level programming language. It is very simple and straightforward such that reading Python code is almost close to reading English text. While it is mostly being used on data science and machine learning projects, Python is a general-purpose programming language; it can be used to perform a range of tasks such as building desktop, web, and even mobile applications.

The Python programming language is embellished with loads of features such as objects, modules, threads, exceptions, and automatic memory management.

Regarding the benefits of Python, it is simple and easy for anyone to understand it. Python is termed as portable, meaning, one can write once and run anywhere. Python has a built-in data structure which makes it an ideal candidate for scientific and machine learning projects. Last but not least, it is open source.

Oswald Gerald: Is Python really a rockstar programming language as you’ve just described it to be? I am very curious to learn if it has any limitations? If yes, please help to elaborate.

Kalebu Jordan: Sure. It is true that the Python programming language is very good at what it was created to become — interpreted and high-level, simple but powerful, and last but not least, a language with very clear syntax. With such great power and flexibility — speed and performance are the most common trade-offs; that is why compared to other common programming languages, Python is known to be slow.

Let me try to expand a little on how Python is labeled as a slow language.

  1. Python is interpreted. Python operates with the assistance of an interpreter (not a compiler like C ). Python code needs to be converted into an intermediary code form before it is understood by the machine. In effect, this makes Python portable such that it can run on different environments, but the downside, Python pays the cost on speed and performance.
  2. Python as a very clear syntax. Python code looks good in text. There aren’t any semicolons, indentations are used instead of curl braces, and for my favorite feature, there are no types. The lack of types is a huge point, as it makes the language simpler to read and write — but the interpreter needs to be smart enough to figure-out variable types at runtime. Frankly, comparing and converting types at runtime is very costly on speed and performance.

In closing, I am going to give props where props are due — it is in Python’s nature to be dynamic, and extremely portable. This is a deliberate design choice that has made Python an ideal candidate for so many programming tasks. So, if in need of further optimization and speed, the kind that the default Python does not offer, seek its much more optimized alternatives.

The Pretty Pickle

Oswald Gerald: I just started using the pickle Python module. I have to say, it is amazing how my data wrangling life has become super easy. For the benefit of our audience, I am curious to know how it is you use the pickle module.

Kalebu Jordan: The pickle module is so awesome it makes you want to eat it.

All puns aside, my first encounter with the terms pickling and unpickling was when I first embarked on my machine learning journey with sci-kit learn. The challenge I was trying to solve was, extract data contained within my machine learning model for later use. What I came to find out was that I can use the Python’s pickle module to convert any Python object (list, dict, etc.) into a stream of characters that I can then save to a file on disk for future use.

To wrap it up, the pickle module accepts any Python object and converts it into a string representation that you can then dump into a file by using the dump function. This process of converting a Python object into a string representation is called pickling. The process of retrieving the original Python object from a stored string representation is called unpickling.

Special Picks

Oswald Gerald: Kalebu, on behalf of everyone that was able to attend today’s session— we really appreciate you. Thank you for taking the time to share with us your passion for Python, and I believe I speak for many when I say, thank you for sparking an obsession for Python and machine learning in us.

Kalebu Jordan: Thanks a lot guys. The pleasure was truly mine. It is my hope that I will be welcomed next time to share more and learn from you guys.

Oswald Gerald: Before I let you go, would you be so kind as to share some of your favorite tools, libraries, frameworks, or favorite coffee spots?

Kalebu Jordan: I’d be happy to. Hmm, my favorite Python tools — I think they are plenty, I will try to name a few.

  1. Tkinter when it comes to building desktop applications.
  2. I am fluent in Scikit-learn, but, I am a huge fun of PyTorch.
  3. When it comes to scraping the web, my choices would be Requests, beautiful soup, and Scrapy, respectively.
  4. Oh, and I use rebound. I love Stack Overflow — rebound instantly fetches Stack Overflow results when an exception is thrown
  5. Last but not least, open-source, all day — every day.

Closing Remarks

Perhaps you missed our last session? Perhaps you are beginning your Python journey? Or, perhaps you are a seasoned Python magician? If you are willing, we will be overjoyed to have you join us as a speaker or attendee.

For updates on previous and upcoming study-jam sessions, follow us on Twitter.

For every study-jam session, all class notes and code examples are hosted on our GitHub repository. Give it a star — we will appreciate the love.

--

--

forLoop Tanzania
Dive Into Python 3

A community of developers by developers for developers in Tanzania.