Python tutorials

Python Programming in Interactive vs Script Mode

In Python, there are two options/methods for running code: Interactive mode Script mode In this article, we will see the difference between the modes and will also discuss the pros and cons of running scripts in both of these modes. Interactive Mode Interactive mode, also known as the REPL provides us with a quick way of running blocks or a single line of Python code. The code executes via the Python shell, which comes with Python installation. Interactive mode is […]

Read more

Python Performance Optimization

Introduction Resources are never sufficient to meet growing needs in most industries, and now especially in technology as it carves its way deeper into our lives. Technology makes life easier and more convenient and it is able to evolve and become better over time. This increased reliance on technology has come at the expense of the computing resources available. As a result, more powerful computers are being developed and the optimization of code has never been more crucial. Application performance […]

Read more

Converting Python Scripts to Executable Files

Introduction In this tutorial, we will explore the conversion of Python scripts to Windows executable files in four simple steps. Although there are many ways to do it, we’ll be covering, according to popular opinion, the simplest one so far. This tutorial has been designed after reviewing many common errors that people face while performing this task, and hence contains detailed information to install and set up all the dependencies as well. Feel free to skip any step, if you […]

Read more

Sorting and Merging Single Linked List

In the last article, we started our discussion about the linked list. We saw what the linked list is along with its advantages and disadvantages. We also studied some of the most commonly used linked list method such as traversal, insertion, deletion, searching, and counting an element. Finally, we saw how to reverse a linked list. In this article, we will continue from where we left in the last article and will see how to sort a linked list using […]

Read more

Understanding ROC Curves with Python

In the current age where Data Science / AI is booming, it is important to understand how Machine Learning is used in the industry to solve complex business problems. In order to select which Machine Learning model should be used in production, a selection metric is chosen upon which different machine learning models are scored. One of the most commonly used metrics nowadays is AUC-ROC (Area Under Curve – Receiver Operating Characteristics) curve. ROC curves are pretty easy to understand […]

Read more

Introduction to the Python Pathlib Module

The Pathlib module in Python simplifies the way in working with files and folders. The Pathlib module is available from Python 3.4 and higher versions. It combines the best of Python’s file system modules namely os, os.path, glob, etc. In Python, most of the scripts involve interacting with file systems. Hence, it is important to deal with file names and paths. To achieve this, Python includes the Pathlib module which contains useful functions to perform file-related tasks. Pathlib provides a […]

Read more

Doubly Linked List with Python Examples

This is the third article in the series of articles on implementing linked list with Python. In Part 1 and Part 2 of the series we studied single linked list in detail. In this article, we will start our discussion about doubly linked list, which is actually an extension of single linked list. In single linked list each node of the list has two components, the actual value of the node and the reference to the next node in the […]

Read more

Affine Image Transformations in Python with Numpy, Pillow and OpenCV

In this article I will be describing what it means to apply an affine transformation to an image and how to do it in Python. First I will demonstrate the low level operations in Numpy to give a detailed geometric implementation. Then I will segue those into a more practical usage of the Python Pillow and OpenCV libraries. This article was written using a Jupyter notebook and the source can be found at my GitHub repo so, please feel free […]

Read more

Introduction to Python Decorators

Introduction In Python, a decorator is a design pattern that we can use to add new functionality to an already existing object without the need to modify its structure. A decorator should be called directly before the function that is to be extended. With decorators, you can modify the functionality of a method, a function, or a class dynamically without directly using subclasses. This is a good idea when you want to extend the functionality of a function that you […]

Read more

Introduction to Python OS Module

In this tutorial, you will learn how to work along with Python’s os module. Table of Contents Introduction Basic Functions List Files / Folders in Current Working Directory Change working Directory Create Single and Nested Directory Structure Remove Single and Nested Directory Structure Recursively Example with Data Processing Conclusion Introduction Python is one of the most frequently used languages in recent times for various tasks such as data processing, data analysis, and website building. In this process, there are various […]

Read more
1 133 134 135 136 137 163