Pradeep Elance has Published 417 Articles

Python Categorize the given list by string size

Pradeep Elance

Pradeep Elance

Updated on 09-Jul-2020 13:30:19

210 Views

Let's consider a list containing many strings of different lengths. In this article we will see how to club those elements into groups where the strings are of equal length in each group.With for loopWe design a for loop which will iterate through every element of the list and happened ... Read More

Correlation and Regression in Python

Pradeep Elance

Pradeep Elance

Updated on 09-Jul-2020 13:21:47

3K+ Views

Correlation refers to some statistical relationships involving dependence between two data sets. While linear regression is a linear approach to establish the relationship between a dependent variable and one or more independent variables. A single independent variable is called linear regression whereas multiple independent variables is called multiple regression.CorrelationSimple examples ... Read More

Converting an image to ASCII image in Python

Pradeep Elance

Pradeep Elance

Updated on 09-Jul-2020 13:10:56

594 Views

In this article we we want to convert a given images into a text bases image also called ASCII image.Below is the Python program which will take an input imagee and various functions to convert them into grayscale picture and then apply the ASCII characters to create different patterns insert ... Read More

Boolean list initialization in Python

Pradeep Elance

Pradeep Elance

Updated on 09-Jul-2020 13:04:18

2K+ Views

There are scenarios when we need to get a list containing only the Boolean values like true and false. In this article how to create list containing only Boolean values.With rangeWe use range function giving it which is the number of values we want. Using a for loop we assign ... Read More

Binary element list grouping in Python

Pradeep Elance

Pradeep Elance

Updated on 09-Jul-2020 12:46:49

236 Views

Suppose we have a list of lists in which each sublist has two elements. One element of each sublist is common across many other subjects of the list. We need to create a final list which will show sublists grouped by common elements.With set and mapIn the given list the ... Read More

Add the occurrence of each number as sublists in Python

Pradeep Elance

Pradeep Elance

Updated on 09-Jul-2020 12:42:17

179 Views

We have a list whose elements are numeric. Many elements are present multiple times. We want to create sub list so the frequency of each element along with the elements itself.With for and appendIn this approach we will compare each element in the list with every other elements after it. ... Read More

Add only numeric values present in a list in Python

Pradeep Elance

Pradeep Elance

Updated on 09-Jul-2020 12:38:59

1K+ Views

We have a Python list which contains both string and numbers. In this article we will see how to sum up the numbers present in such list by ignoring the strings.With filter and isinstanceThe isinstance function can be used to filter out only the numbers from the elements in the ... Read More

Accessing Key-value in a Python Dictionary

Pradeep Elance

Pradeep Elance

Updated on 09-Jul-2020 12:37:20

5K+ Views

While analyzing data using Python data structures we will eventually come across the need for accessing key and value in a dictionary. There are various ways to do it in this article we will see some of the ways.With for loopUsing a for loop we can access both the key ... Read More

Accessing index and value in a Python list

Pradeep Elance

Pradeep Elance

Updated on 09-Jul-2020 12:34:46

3K+ Views

When we use a Python list, will be required to access its elements at different positions. In this article we will see how to get the index of specific elements in a list.With list.IndexThe below program sources the index value of different elements in given list. We supply the value ... Read More

A += B Assignment Riddle in Python

Pradeep Elance

Pradeep Elance

Updated on 03-Jul-2020 07:49:19

128 Views

In this chapter we see what happens when we update the values in a tuple, which is actually immutable. We will be able to merge new values with old values but that throws an error. We can study the bytecode of the error and understand better how the rules for ... Read More

Advertisements