Pradeep Elance has Published 417 Articles

Find fibonacci series upto n using lambda in Python

Pradeep Elance

Pradeep Elance

Updated on 26-Aug-2020 07:43:29

3K+ Views

A fibinacci series is a widley known mathematical series that explains many natural phenomenon. It starts with 0 and 1 and then goes on adding a term to its previous term to get the next term. In this article we will see how to generate a given number of elements ... Read More

Find elements within range in numpy in Python

Pradeep Elance

Pradeep Elance

Updated on 26-Aug-2020 07:41:23

2K+ Views

Sometime while processing data using the numpy library, we may need to filter out certain numbers in a specific range. This can be achieved by using some in-built methods available in numpy.With and operatorIn this approach we take an numpy array then apply the logical_and function to it. The where ... Read More

Find depth of a dictionary in Python

Pradeep Elance

Pradeep Elance

Updated on 26-Aug-2020 07:40:38

894 Views

A python dictionary can be nested i.e., there are dictionaries within a dictionary. In this article we will see how to calculated the level of nesting in a dictionary when there is a nested dictionary.With string conversionIn this approach we convert the entire dictionary into a string. Then we count ... Read More

Find common elements in three sorted arrays by dictionary intersection in Python

Pradeep Elance

Pradeep Elance

Updated on 26-Aug-2020 07:38:40

314 Views

While manipulating data using python we may come across situation where we need to find the elements which are common among the multiple arrays. This can be achieved by converting the arrayd into dictionaries as shown below.In the below example we take the arrays and apply the Counter container from ... Read More

Find all triplets in a list with given sum in Python

Pradeep Elance

Pradeep Elance

Updated on 26-Aug-2020 07:37:24

1K+ Views

In a list of numbers we want to find out which three elements can join to give a certain sum. We call it a triplet. And in the list there can be many such triplets. For example, the sum 10 can be generated form numbers 1, 6, 3 as well ... Read More

Find all possible substrings after deleting k characters in Python

Pradeep Elance

Pradeep Elance

Updated on 26-Aug-2020 07:33:55

210 Views

we are given a string. The required task is to take out one letter from the string and print the remaining letters in the string. And this we have to so for each letter of the string.With loops and rangeThis is a basic programming approach in which we first list ... Read More

Find all elements count in list in Python

Pradeep Elance

Pradeep Elance

Updated on 26-Aug-2020 07:31:51

358 Views

Many times we need to count the elements present in a list for some data processing. But there may be cases of nested lists and counting may not be straight forward. In this article we will see how to handle these complexities of counting number of elements in a list.With ... Read More

Find all distinct pairs with difference equal to k in Python

Pradeep Elance

Pradeep Elance

Updated on 26-Aug-2020 07:30:23

387 Views

In this article we are going to see how to count the numbers of pairs of numbers which have an exact difference equal to k. The given numbers are in form of a list and we supply the value of k to the program.Using for LoopIn this approach we design ... Read More

Extracting rows using Pandas .iloc[] in Python

Pradeep Elance

Pradeep Elance

Updated on 26-Aug-2020 07:27:29

671 Views

Pandas is a famous python library that Is extensively used for data processing and analysis in python. In this article we will see how to use the .iloc method which is used for reading selective data from python by filtering both rows and columns from the dataframe.iloc method processes data ... Read More

Duplicate substring removal from list in Python

Pradeep Elance

Pradeep Elance

Updated on 26-Aug-2020 07:18:09

380 Views

Sometimes we may have a need to refine a given list by eliminating the duplicate elements in it. This can be achieved by using a combination of various methods available in python standard library.with set and splitThe split method can be used to segregate the elements for duplicate checking and ... Read More

Previous 1 ... 6 7 8 9 10 ... 42 Next
Advertisements