Top 10 math functions in python

The math module provides us various functions. Some of them are discussed in this article. Import the math function to begin. The ten methods in this article are ceil and floor factorial gcd sqrt pow sin, cos, tan exp fabs isclose constants Ceil and floor functions The ceil() method returns an integer which is greater […]

Read More

Create an image using numpy array – random pixel values

As we all know pixel is the smallest unit in a picture and each picture will be made up of pixels. These pixels usually contains values which represents a colour. For example 0 is black and 255 is black. Any value between this will be some shade of gray. I wanted to create an image […]

Read More

Calendar module in python – print calendars and other cool functions

The calendar module in python enables us to print calendars on the terminal and other cool functions with the calendar. Import the calendar module to access all these functions. Print a month’s calendar The prmonth() method helps us to print a month’s calendar. It requires the year and the month in the form of integers […]

Read More

django get first and last element from a queryset

In django a queryset is similar to a list but does not support negative indexing like a normal list. This makes it difficult to get the last element by traditional method. Let us say we have a model like this. This is a simple post model which have two fields “title” and “date”. If we […]

Read More

Keywords in python – A list of python keywords and their functions

In this article let us see a list of keywords in python and also the specific functions of each keyword. What are keywords? Keywords are the reserved words in Python. We cannot use a keyword as a variable name, function name, or any other identifier. They are used to define the syntax and structure of the Python language. keywords […]

Read More

Take screenshots of web pages using python

Sometimes we want to take a screenshot of a webpage directly using our code without visiting the page.  Thanks to “pyppeteer“. With the help of this python library we can take full page screenshots and normal screenshots. Installation You can install pypuppeteer from pypi using pip. Pyppeteer requires python 3.6+. (experimentally supports python 3.5) Note: […]

Read More

All builtin functions in python – Part 1

In this article i will be talking about all the builtin functions in python with an example for each. The following is the list of functions that we will be dealing with. abs() all() any() ascii() bin () bool() breakpoint() chr() complex() divmod() abs() The abs() function will return an absolute value of a number. […]

Read More

Post a tweet to Twitter using python

In our last article we have seen how to get our followers and following list and write those names to an excel sheet. If you have not read the article please go and have a look. In this article we are going to tweet from python using the “twitter-python”. The prerequisites and the steps to […]

Read More

Convert audio files to graph visualisation

In this article we shall how we can convert an audio file to its graph visualisation. The graph is plotted by taking the frequencies of the audio file as a numpy array. Let us get started. Libraries needed We will need the following two libraries for this task. soundfile matplotlib both can be installed via […]

Read More