Pradeep Elance has Published 417 Articles

Finding Mean, Median, Mode in Python without Libraries

Pradeep Elance

Pradeep Elance

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

11K+ 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

1K+ 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

990 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

2K+ 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

833 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

Finally keyword in Python

Pradeep Elance

Pradeep Elance

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

366 Views

In any programming language we find a situation where exceptions are raised. Python has many inbuilt exception handling mechanisms. There are errors which are handled by this exception names. Python also has a block called finally which is executed irrespective of whether the exception is handled or not.Syntaxtry:    # ... Read More

divmod() in Python and its application

Pradeep Elance

Pradeep Elance

Updated on 07-Aug-2019 08:32:04

1K+ Views

The divmod() is part of python’s standard library which takes two numbers as parameters and gives the quotient and remainder of their division as a tuple. It is useful in many mathematical applications like checking for divisibility of numbers and establishing if a number is prime or not.SyntaxSyntax: divmod(a, b) ... Read More

Count frequencies of all elements in array in Python using collections module

Pradeep Elance

Pradeep Elance

Updated on 07-Aug-2019 08:18:37

360 Views

As python allows duplicate elements in a list we can have one element present multiple Times. The frequency of elements in a list indicates how many times an element occurs in a list. In this article we use the Counter function of the collections module to find out the frequency ... Read More

Count distinct elements in an array in Python

Pradeep Elance

Pradeep Elance

Updated on 07-Aug-2019 08:15:52

629 Views

In a list in Python we may have duplicate elements. When we count the length of the list we get the total length including the duplicate elements. But in this article we will see how to get the total count of the distinct elements or unique elements in a list.ExampleIn ... Read More

casefold() string in Python

Pradeep Elance

Pradeep Elance

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

172 Views

This function is helpful in converting the letters of a word into lowercase. When applied to two strings it can match their values irrespective of the type up of the case of the letters.Applying casefold()The below example we apply the casefold() function to a string and the result comes out ... Read More

Advertisements