An underused library with important features

Photo by Doran Erickson on Unsplash

What Can Functools (Function-tools) do for us?

The STL library “functools” have great features, allow us to modify our function, with little to no code, and add functionality to them.

Reduce

Reduce takes a function of 2 arguments, and an iterable.

This method could come in handy in custom functions that want…


Python unittest full walkthrough

Photo by Jon Tyson on Unsplash

Unit-Testing

Unit-testing is a basic run of your code. It’s not QA. This way, you verify that you’ve written quality code and not something that will break the minute someone else tries to use it.

Why Test?

Recently, at a startup, I needed to write library code for a co-worker, I gave him the library code with a unit-test script.


Zero to semi-hero

Photo by Steve Halama on Unsplash

Python is, in my opinion, the simplest and most effective programming language you can learn, it is readable and open source, and the possibilities are just endless.

What This Article Trying To Achieve

Well, pretty simple — teach Python, right?
Yes, and no, this article will teach you functional Python, the real fundamentals of Python, no fancy libraries, or email automation. Still, if you’ll stick through, you’ll have the understanding to dive into most articles, and benefit something from them.

With the first 1000 most common words of a language, you can understand somewhere between 60–70% of an every day chat, the second thousand — will…


The things you have to know — to improve your Python skills

Image Source

The Python Path

Python has this charm to it. The crowds speak of it, almost romantically, how it is “just plain English.” It is so “simple and easy to understand” and the power of importing the fantastic modules of the open-source community — everything within your grasp.

Well, isn’t that true?

It is, no doubt about it, but that my friends is level 1.


one small syntax change, one giant step for your coding skills

Photo by Angelina Kichukova on Unsplash

The Syntax Language

Python is widely known for its simplicity, easy syntax, which requires basic English to understand, which made it so famous.

Getting the ball rolling

I’ll start with a small trick:

Easy Way To Combine Dicts!


The most essential starting point for any data analyst

Linear regression in 1D

The Advantages

Machine learning can save you the hassle of building a complex set of rules for a given problem, which might not be ideal and is much harder to maintain.
With the right guidance, machine learning can find better and quicker methods to solve your problems.

Where Do I Start?

First, we will start with the basic concept. Later, we will do some graphing and coding just to have an easier understanding of the matter and its implications. Afterward, the actual implementation will be even simpler than this article’s concept (this part will be at the end).


Because if you're already testing your code while writing it, do it right

Photo by Carlos Muza on Unsplash

Why Test?

Unit Testing is an important aspect of development. Without the basic runs of your code, how do you know if it works?
also, since unit-testing is often quick and short, by managing unit-testing correctly you can also know if you broke old code or someone else’s code!

The wrong and common way

Let us start by showing the wrong and common method.
here’s a simple class object:

As you can see, this class doesn’t do much, it takes a number power that number on a…


Because the devil is in the small details

Photo by Kevin Ku on Unsplash

At the beginning

I'm sure you all heard, “learn python, its simple, easy, fun syntax, and it just works”.

I/O vs CPU bound

Computer science has 2 major computation problems — I/O (input/output) problem, and CPU (computation) problems, this article will address these two.

I/O Solution


How to make a thread based program deterministic, and processed by importance.

Photo by Daniel Jerez on Unsplash

The Queue

The queue is a standard python object — build especially to synchronize your threads.

What is the Queue for?

The queue object gives you a number of advantages, first, you can limit the amount of data waiting to be processed, which can help prevent memory leaks, you can have it organized by importance — and this way make sure that too much data from a less important thread — will not delay processing data from important thread.

An example will make things easier

Let's start with a simple example — you have a camera in a museum, guarding a painting, you're getting data from that camera through a read thread, and…


Because sometimes, people feel the need to click a button.

Photo by R Mo on Unsplash

Pyqt

PyQt is a Python package to work with a cross-platform Qt GUI interface.

Dorel Masasa

Senior Python Developer and Big Data Researcher, For Any Request/Question On a Topic, Feel Free To Mail — masasaMedium@gmail.com

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store