Pradeep Elance has Published 446 Articles

10 Interesting Python Cool Tricks

Pradeep Elance

Pradeep Elance

Updated on 08-Aug-2019 06:52:06

4K+ Views

With increase in popularity of python, more and more features are becoming available for python coding. Using this features makes writing the code in fewer lines and cleaner. In this article we will see 10 such python tricks which are very frequently used and most useful.Reversing a ListWe can simply ... Read More

How to download Google Images using Python

Pradeep Elance

Pradeep Elance

Updated on 08-Aug-2019 06:41:47

995 Views

Google offers many python packages which minimize the effort to write python code to get data from google services. One such package is google images download. It takes in the key words as parameters and locates the images with those keywords.ExampleIn the below example we limit the number of images ... Read More

How to clear screen in python?

Pradeep Elance

Pradeep Elance

Updated on 08-Aug-2019 06:38:47

5K+ Views

In Python sometimes we have link the output and we want to clear the screen in the cell prompt we can clear the screen by pressing Control + l . But there are situations when we need to clear the screen programmatically depending on the amount of output from the ... Read More

frozenset() in Python

Pradeep Elance

Pradeep Elance

Updated on 08-Aug-2019 06:31:31

264 Views

This function helps in converting a mutable list to an immutable one. This is needed when we have declared a list whose items are changeable but after certain steps we want to stop allowing the elements in it to change. In such scenario, we apply the frozenset() function as shown ... Read More

float() in Python

Pradeep Elance

Pradeep Elance

Updated on 07-Aug-2019 08:55:11

220 Views

Float method is part of python standard library which converts a number or a string containing numbers to a float data type. There are following rules when a string is considered to be valid for converting it to a float.The string must have only numbers in it.Mathematical operators between the ... Read More

Finding Mean, Median, Mode in Python without Libraries

Pradeep Elance

Pradeep Elance

Updated on 07-Aug-2019 08:51:42

9K+ Views

Mean, Median and Mode are very frequently used statistical functions in data analysis. Though there are some python libraries.Finding MeanMean of a list of numbers is also called average of the numbers. It is found by taking the sum of all the numbers and dividing it with the count of ... Read More

Find the k most frequent words from data set in Python

Pradeep Elance

Pradeep Elance

Updated on 07-Aug-2019 08:48:10

826 Views

If there is a need to find 10 most frequent words in a data set, python can help us find it using the collections module. The collections module has a counter class which gives the count of the words after we supply a list of words to it. We also ... Read More

Find size of a list in Python

Pradeep Elance

Pradeep Elance

Updated on 07-Aug-2019 08:46:48

834 Views

A list is a collection data type in Python. The elements in a list are change able and there is no specific order associated with the elements. In this article we will see how to find the length of a list in Python. Which means we have to get the ... Read More

Find length of a string in python (3 ways)

Pradeep Elance

Pradeep Elance

Updated on 07-Aug-2019 08:44:46

1K+ Views

String is a python which is a series of Unicode characters. Once declared it is not changeable. In this article we'll see what are the different ways to find the length of a string.Using the len()This is the most straight forward way. Here we use a library function named len(). ... Read More

Find all the numbers in a string using regular expression in Python

Pradeep Elance

Pradeep Elance

Updated on 07-Aug-2019 08:42:28

595 Views

Extracting only the numbers from a text is a very common requirement in python data analytics. It is done easily using the python regular expression library. This library helps us define the patterns for digits which can be extracted as substrings.ExamplesIn the below example we use the function findall() from ... Read More

Advertisements