Python tutorials

Rounding Numbers in Python

Using a computer in order to do rather complex Math is one of the reasons this machine was originally developed. As long as integer numbers and additions, subtractions, and multiplications are exclusively involved in the calculations, everything is fine. As soon as floating point numbers or fractions, as well as divisions, come into play it enormously complicates the whole matter. As a regular user, we are not fully aware of these issues that happen behind the scenes and may end […]

Read more

Python Docstrings

As already pointed out in a previous article titled Commenting Python Code you have learned that documentation is an essential, and a continuous step in the process of software development. The article mentioned above briefly introduced the concept of docstrings which is a way to create documentation for your Python code from within the code. This in-code documentation works for modules, classes, methods, and functions, and it is the preferred way to document all Python code. There is a lot […]

Read more

Using Django Signals to Simplify and Decouple Code

Introduction Systems are getting more complex as time goes by and this warrants the need to decouple systems more. A decoupled system is easier to build, extend, and maintain in the long run since not only does decoupling reduce the complexity of the system, each part of the system can be managed individually. Fault tolerance has also enhanced since, in a decoupled system, a failing component does not drag down the entire system with it. Django is a powerful open-source […]

Read more

Basics of Memory Management in Python

Introduction Memory management is the process of efficiently allocating, de-allocating, and coordinating memory so that all the different processes run smoothly and can optimally access different system resources. Memory management also involves cleaning memory of objects that are no longer being accessed. In Python, the memory manager is responsible for these kinds of tasks by periodically running to clean up, allocate, and manage the memory. Unlike C, Java, and other programming languages, Python manages objects by using reference counting. This […]

Read more

Debugging Python Applications with the PDB Module

Introduction In this tutorial, we are going to learn how to use Python’s PDB module for debugging Python applications. Debugging refers to the process of removing software and hardware errors from a software application. PDB stands for “Python Debugger”, and is a built-in interactive source code debugger with a wide range of features, like pausing a program, viewing variable values at specific instances, changing those values, etc. In this article, we will be covering the most commonly used functionalities of […]

Read more

Python String Interpolation with the Percent (%) Operator

There are a number of different ways to format strings in Python, one of which is done using the % operator, which is known as the string formatting (or interpolation) operator. In this article we’ll show you how to use this operator to construct strings with a template string and variables containing your data. The % Operator This way of working with text has been shipped with Python since the beginning, and it’s also known as C-style formatting, as it […]

Read more

Python for NLP: Creating Multi-Data-Type Classification Models with Keras

This is the 18th article in my series of articles on Python for NLP. In my previous article, I explained how to create a deep learning-based movie sentiment analysis model using Python’s Keras library. In that article, we saw how we can perform sentiment analysis of user reviews regarding different movies on IMDB. We used the text of the review the review to predict the sentiment. However, in text classification tasks, we can also make use of the non-textual information […]

Read more

Minimax with Alpha-Beta Pruning in Python

Introduction Way back in the late 1920s John Von Neumann established the main problem in game theory that has remained relevant still today: Players s1, s2, …, sn are playing a given game G. Which moves should player sm play to achieve the best possible outcome? Shortly after, problems of this kind grew into a challenge of great significance for development of one of today’s most popular fields in computer science – artificial intelligence. Some of the greatest accomplishments in […]

Read more

Python for NLP: Multi-label Text Classification with Keras

Introduction This is the 19th article in my series of articles on Python for NLP. From the last few articles, we have been exploring fairly advanced NLP concepts based on deep learning techniques. In the last article, we saw how to create a text classification model trained using multiple inputs of varying data types. We developed a text sentiment predictor using textual inputs plus meta information. In this article, we will see how to develop a text classification model with […]

Read more

Introduction to the Python Pyramid Framework

Introduction In this tutorial, we’re going to learn how to use the Pyramid framework in Python. It is an open source web development framework which uses the Model-View-Controller (MVC) architecture pattern and is based on Web Server Gateway Interface (WSGI). The Pyramid framework has a lot of useful add-on packages that make web development a lot more convenient. Some other popular alternatives for web development in Python include Django and Flask. Prerequisites You need to have basic knowledge of HTML […]

Read more
1 158 159 160 161 162 181