Python tutorials

Introduction to the Python lxml Library

lxml is a Python library which allows for easy handling of XML and HTML files, and can also be used for web scraping. There are a lot of off-the-shelf XML parsers out there, but for better results, developers sometimes prefer to write their own XML and HTML parsers. This is when the lxml library comes to play. The key benefits of this library are that it’s ease of use, extremely fast when parsing large documents, very well documented, and provides […]

Read more

Python for NLP: Introduction to the TextBlob Library

Introduction This is the seventh article in my series of articles on Python for NLP. In my previous article, I explained how to perform topic modeling using Latent Dirichlet Allocation and Non-Negative Matrix factorization. We used the Scikit-Learn library to perform topic modeling. In this article, we will explore TextBlob, which is another extremely powerful NLP library for Python. TextBlob is built upon NLTK and provides an easy to use interface to the NLTK library. We will see how TextBlob […]

Read more

Introduction to the Python Calendar Module

Introduction Python has an built-in module named Calendar that contains useful classes and functions to support a variety of calendar operations. By default, the Calendar module follows the Gregorian calendar, where Monday is the first day (0) of the week and Sunday is the last day of the week (6). In Python, datetime and time modules also provide low-level calendar-related functionalities. In addition to these modules, the Calendar module provides essential functions related to displaying and manipulating calendars. To print […]

Read more

Working with PDFs in Python: Reading and Splitting Pages

This article is the first in a series on working with PDFs in Python: The PDF Document Format Today, the Portable Document Format (PDF) belongs to the most commonly used data formats. In 1990, the structure of a PDF document was defined by Adobe. The idea behind the PDF format is that transmitted data/documents look exactly the same for both parties that are involved in the communication process – the creator, author or sender, and the receiver. PDF is the […]

Read more

Deep vs Shallow Copies in Python

Introduction In this tutorial, we are going to discuss shallow copies vs deep copies with the help of examples in Python. We will cover the definition of a deep and shallow copy, along with its implementation in the Python language to evaluate the core differences between the two types of copies. In many of the programs that we write, no matter how basic they are, we end up needing to copy a list or an object for one of many […]

Read more

Python for NLP: Introduction to the Pattern Library

This is the eighth article in my series of articles on Python for NLP. In my previous article, I explained how Python’s TextBlob library can be used to perform a variety of NLP tasks ranging from tokenization to POS tagging, and text classification to sentiment analysis. In this article, we will explore Python’s Pattern library, which is another extremely useful Natural Language Processing library. The Pattern library is a multipurpose library capable of handling the following tasks: Natural Language Processing: […]

Read more

Analysis of Black Friday Shopping Trends via Machine Learning

Introduction Wikipedia defines Black Friday as an informal name for the Friday following Thanksgiving Day in the United States, which is celebrated on the fourth Thursday of November. [Black Friday is] regarded as the beginning of America’s Christmas shopping season […]. In this article, we will try to explore different trends from the Black Friday shopping dataset. We will extract useful information that will answer questions such as: what gender shops more on Black Friday? Do the occupations of the […]

Read more

Constraint Programming with python-constraint

Introduction The first thing we have to understand while dealing with constraint programming is that the way of thinking is very different from our usual way of thinking when we sit down to write code. Constraint programming is an example of the declarative programming paradigm, as opposed to the usual imperative paradigm that we use most of the time. What is a programming paradigm? A paradigm means “an example” or “a pattern” of something. A programming paradigm is often described […]

Read more

The Python Math Library

Introduction The Python Math Library provides us access to some common math functions and constants in Python, which we can use throughout our code for more complex mathematical computations. The library is a built-in Python module, therefore you don’t have to do any installation to use it. In this article, we will be showing example usage of the Python Math Library’s most commonly used functions and constants. Special Constants The Python Math Library contains two important constants. Pie The first […]

Read more

Python for NLP: Getting Started with the StanfordCoreNLP Library

This is the ninth article in my series of articles on Python for NLP. In the previous article, we saw how Python’s Pattern library can be used to perform a variety of NLP tasks ranging from tokenization to POS tagging, and text classification to sentiment analysis. Before that we explored the TextBlob library for performing similar natural language processing tasks. In this article, we will explore StanfordCoreNLP library which is another extremely handy library for natural language processing. We will […]

Read more
1 153 154 155 156 157 181