Getting Started with MySQL and Python

Introduction For any fully functional deployable application, the persistence of data is indispensable. A trivial way of storing data would be to write it to a file in the hard disk, but one would prefer writing the application specific data to a database for obvious reasons. Python provides language support for writing data to a wide range of databases. Python DB API At the heart of Python support for database programming is the Python DB API (PEP – 249) which […]

Read more

Lambda Functions in Python

What are Lambda Functions? In Python, we use the lambda keyword to declare an anonymous function, which is why we refer to them as “lambda functions”. An anonymous function refers to a function declared with no name. Although syntactically they look different, lambda functions behave in the same way as regular functions that are declared using the def keyword. The following are the characteristics of Python lambda functions: A lambda function can take any number of arguments, but they contain […]

Read more

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
1 808 809 810 811 812 857