# How to Design Professional Venn Diagrams in Python

## A quick guide for plotting stylish and professional Venn diagrams using matplotlib-venn

Last week I was designing some reading material for my Python Class. The lecture topic was Python Sets.

For illustrating some functions, I wanted to plot Venn Diagrams. Yes, the overlapping circle charts that you often find in data presentations.

My search for open-source tools for designing professional looking Venn Diagrams lead me to tools like Canva, Meta-Chart, and Creately. While they had appealing designs, none of them had the required elegance and were seldom customizable.

The matplotlib-venn library allows you to completely customize your Venn diagrams, from the size of the circles to border type and line width. Here is a sample plot generated using this library. …

# How to Deal with Missing Data in Python

## Using Pandas and NumPy for handling missing values in your dataset

Last year I was working on a project that dealt with Twitter data. We had around a billion tweets in our database. I needed to clean our data so that we can run some machine learning models on it.

Here is a snapshot of the Dataset:

# A Complete Guide to the Python Range Function

## Learn how to use the range function with the help of different examples

`Range` is a built-in Python function that returns a sequence of numbers between a start integer (`0` by default) and a stop integer.

We can iterate over the sequence generated by the `range` function using a for/while loop:

`print("Getting a sequence of numbers between 0 and 10")for i in range(10):    print(i, end =' ')    # Output# Getting a sequence of numbers between 0 and 10# 0 1 2 3 4 5 6 7 8 9`

# A Complete Guide to User Input in Python

## Learning about the Python input function in detail along with its many use-cases

User input is critical for building interactive programs. Every programming language has its unique implementation of an input interface. C++ has `scanf`, Java has the `Scanner` class, and Ruby has `gets`.

While in most cases, this input stems from the keyboard, other forms like mouse clicks, track-pad, sensors, etc. are also possible.

As always, Python provides a simple framework for getting user input in the form of the `input()` function.

In this tutorial, we will cover the `input()` function in detail using a variety of use-cases. We will discuss the several forms in which input can exist and how to parse this input into our required format with the help of code snippets. …

# The Man Who Pioneered Infection Control: Ignaz Semmelweis

## A small tribute to the man who introduced hand-washing and antisepsis to the surgery room

As millions continue to be affected by the scourge of COVID-19, the significance of simple hygiene practices like hand-washing is amplified. CDC has time and again recommended washing hands regularly, stating bluntly that it saves lives.

We are all aware of the importance of washing our hands. Hospitals supply medical practitioners with antiseptic gel before treating patients vulnerable to infection.

One would be hard-pressed to imagine a world where doctors did not sanitize or wash their hands before or after examinations. Yet, we lived in such a world just a little less than 150 years ago.

Until the late 1800s, doctors and health workers did not sanitize or even wash their hands between treating patients, even between surgeries. …

# Stop Using Semicolons in Python

## They are seldom useful and don’t look pretty

Coming from a C/C++ background, I am used to seeing a lot of semi-colons `;` in code. They are used to represent statement termination.

But, Python does not mandate the use of semi-colons for delimiting statements. Yet, I often come across Python code littered with semi-colons.

Most recently, I was going through a Data Science with Python Course. The instructor was introducing conditional statements and wrote the following piece of code:

`temp = 10;if temp <12: print('It is cold'); cold = True;`

My reaction: Pure Horror!

Semi-colons are used only in atypical situations in Python. So, I prepared a small guide explaining why you shouldn’t use semi-colons in Python and point out the handful exceptions. …

# How to Deal with Infinity in Python

## Introducing ways of defining and working with Infinite values in Python

Many people think that Infinity is just a very large number. But in reality, Infinity is the idea of something being endless and without any bounds.

Since the early ages, mathematicians have gambled with this concept of endlessness. As John Green wrote in his book The Fault in Our Stars,

“Endlessness is a really strange idea in a universe that is defined by its endings.”

Infinity has many desirable properties for algorithmic design. The most popular being:

# 7 Commands in Python to Make Your Life Easier

## Useful commands for IPython and Jupyter Notebooks

When Python first appeared in 1991, it was seen more as an “at your own risk” computing language. Today it is the predominant language for data science, machine learning, and software development.

A key reason behind Python’s popularity is its flexibility when it comes to adding new features and technologies like magic commands.

So, what exactly is a magic command in Python?

Magic commands are enhancements or shortcuts over the usual Python syntax designed to facilitate routine tasks.

These special commands enable us to easily control the behavior of the IPython system and solve various common problems in standard data analysis, for example, running an external script or calculating the execution time of a piece of code. …

## Learn how to download image files using Python modules like request, urllib and wget.

Recently, I was working with a remote system and needed to download some images that my code will eventually process.

I could have used curl or wget on my terminal for downloading files. But, I wanted the entire process to be automated for the end-user.

This led me to the question:

In this tutorial, I will cover several modules that can be used for downloading files in Python(specifically images). The modules covered are: requests, wget, and urllib.

# Setup

Code used in this tutorial was tested on an Ubuntu system with Python 3.6.9

# Designing Intelligent Python Dictionaries

## A quick guide for designing smart, user-friendly Python Dictionaries

Last week while working on a hobby project, I encountered a very interesting design problem:

Let me explain.