Category Archives: Python

Looping Techniques in Python

Python supports various looping techniques by certain inbuilt functions, in various sequential containers. These methods are primarily verya useful in competitive programming and also in various project which require a specific technique with loops maintaining the overall structure of code. Where they are used ? Different looping techniques are primarily useful in the places where… Read More »

Twitter Sentiment Analysis using Python

This article covers the sentiment analysis of any topic by parsing the tweets fetched from Twitter using Python. What is sentiment analysis? Sentiment Analysis is the process of ‘computationally’ determining whether a piece of writing is positive, negative or neutral. It’s also known as opinion mining, deriving the opinion or attitude of a speaker. Why… Read More »

reduce() in Python

The reduce(fun,seq) function is used to apply a particular function passed in its argument to all of the list elements mentioned in the sequence passed along.This function is defined in “functools” module. Working :  At first step, first two elements of sequence are picked and the result is obtained. Next step is to apply the… Read More »

Working with Images in Python

PIL is the Python Imaging Library which provides the python interpreter with image editing capabilities. It was developed by Fredrik Lundh and several other contributors. Pillow is the friendly PIL fork and an easy to use library developed by Alex Clark and other contributors. We’ll be working with Pillow. Installation: Linux: On linux terminal type… Read More »

Graph Plotting in Python | Set 3

Graph Plotting in Python | Set 1 Graph Plotting in Python | Set 2 Matplotlib is a pretty extensive library which supports Animations of graphs as well. The animation tools center around the matplotlib.animation base class, which provides a framework around which the animation functionality is built. The main interfaces are TimedAnimation and FuncAnimation and… Read More »

XML parsing in Python

This article focuses on how one can parse a given XML file and extract some useful data out of it in a structured way. XML: XML stands for eXtensible Markup Language. It was designed to store and transport data. It was designed to be both human- and machine-readable.That’s why, the design goals of XML emphasize… Read More »

struct module in Python

This module performs conversions between Python values and C structs represented as Python bytes objects. Format strings are the mechanism used to specify the expected layout when packing and unpacking data. Module struct is available in Python 3.x and not on 2.x, thus these codes will run on Python3 interpreter. Struct Functions struct.pack() Syntax: struct.pack(format,… Read More »

Precision Handling in Python

Python in its definition allows to handle precision of floating point numbers in several ways using different functions. Most of them are defined under the “math” module. Some of the most used operations are discussed in this article. 1. trunc() :- This function is used to eliminate all decimal part of the floating point number… Read More »

Inplace vs Standard Operators in Python

Inplace Operators – Set 1, Set 2 Normal operators do the simple assigning job. On other hand, Inplace operators behave similar to normal operators except that they act in a different manner in case of mutable and Immutable targets. The _add_ method, does simple addition, takes two arguments, returns the sum and stores it in… Read More »

Working with PDF files in Python

All of you must be familiar with what PDFs are. In-fact, they are one of the most important and widely used digital media.  PDF stands for Portable Document Format. It uses .pdf extension. It is used to present and exchange documents reliably, independent of software, hardware, or operating system. Invented by Adobe, PDF is now… Read More »

Keywords in Python | Set 2

Python Keywords – Introduction Keywords in Python | Set 1 More keywords: 16. try : This keyword is used for exception handling, used to catch the errors in the code using the keyword except. Code in “try” block is checked, if there is any type of error, except block is executed. 17. except : As… Read More »