Python tutorials

Big O Notation and Algorithm Analysis with Python Examples

There are multiple ways to solve a problem using a computer program. For instance, there are several ways to sort items in an array. You can use merge sort, bubble sort, insertion sort, etc. All these algorithms have their own pros and cons. An algorithm can be thought of a procedure or formula to solve a particular problem. The question is, which algorithm to use to solve a specific problem when there exist multiple solutions to the problem? Algorithm analysis […]

Read more

The Best Data Science Libraries in Python

Preface Due to its exceptional abilities, Python is the most commonly used programming language in the field of Data Science these days. While Python provides a lot of functionality, the availability of various multi-purpose, ready-to-use libraries is what makes the language top choice for Data Scientists. Some of these libraries are well known and widely used, while others are not so common. In this article I have tried to compile a list of Python libraries and categorized them according to […]

Read more

Stacks and Queues in Python

Introduction Data structures organize storage in computers so that we can efficiently access and change data. Stacks and Queues are some of the earliest data structures defined in computer science. Simple to learn and easy to implement, their uses are common and you’ll most likely find yourself incorporating them in your software for various tasks. It’s common for Stacks and Queues to be implemented with an Array or Linked List. We’ll be relying on the List data structure to accommodate […]

Read more

Understanding Recursive Functions with Python

Introduction When we think about repeating a task, we usually think about the for and while loops. These constructs allow us to perform iteration over a list, collection, etc. However, there’s another form of repeating a task, in a slightly different manner. By calling a function within itself, to solve a smaller instance of the same problem, we’re performing recursion. These functions call themselves until the problem is solved, practically dividing the initial problem to a lot of smaller instances […]

Read more

Linked Lists in Detail with Python Examples: Single Linked Lists

Linked lists are one of the most commonly used data structures in any programming language. In this article, we will study linked lists in detail. We will see what are the different types of linked lists, how to traverse a linked list, how to insert and remove elements from a linked list, what are the different techniques to sort a linked list, how to reverse a linked list and so on. After reading this article, you should be able to […]

Read more

Functional Programming in Python

Introduction Functional Programming is a popular programming paradigm closely linked to computer science’s mathematical foundations. While there is no strict definition of what constitutes a functional language, we consider them to be languages that use functions to transform data. Python is not a functional programming language but it does incorporate some of its concepts alongside other programming paradigms. With Python, it’s easy to write code in a functional style, which may provide the best solution for the task at hand. […]

Read more

Relative vs Absolute Imports in Python

While you can put simple projects in a single file, most Python development projects will require multiple files to keep them manageable. That means you need a way to import one file into another. However, many Pythonistas find importing files confusing. Fortunately, it is easy if you know the difference between the various Python import statements. What is Importing? Importing refers to allowing a Python file or a Python module to access the script from another Python file or module. […]

Read more

PyTesseract: Simple Python Optical Character Recognition

Introduction Humans can understand the contents of an image simply by looking. We perceive the text on the image as text and can read it. Computers don’t work the same way. They need something more concrete, organized in a way they can understand. This is where Optical Character Recognition (OCR) kicks in. Whether it’s recognition of car plates from a camera, or hand-written documents that should be converted into a digital copy, this technique is very useful. While it’s not […]

Read more

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
1 150 151 152 153 154 181