Pradeep Elance has Published 417 Articles

Convert list of numerical string to list of Integers in Python

Pradeep Elance

Pradeep Elance

Updated on 20-May-2020 10:53:29

340 Views

For data manipulation using python, we may come across scenario where we have strings containing numbers in a list. To be able to make calculations, we will need to change the strings into numbers. In this article we will see the ways to change the strings into numbers inside a ... Read More

Convert dictionary object into string in Python

Pradeep Elance

Pradeep Elance

Updated on 20-May-2020 10:51:52

361 Views

For data manipulation in python we may come across situation to convert a dictionary object into a string object. This can be achieved in the following ways.with str()In this straight forward method we simple apply the str() by passing the dictionary object as a parameter. We can check the type ... Read More

Convert case of elements in a list of strings in Python

Pradeep Elance

Pradeep Elance

Updated on 20-May-2020 10:48:40

3K+ Views

As part of data manipulation, we will come across the need to have a single case for all the letters in a string. In this article we will see how to take a list which has string elements with mixed cases. We then apply some python functions to convert them ... Read More

Convert byteString key:value pair of dictionary to String in Python

Pradeep Elance

Pradeep Elance

Updated on 20-May-2020 10:47:43

973 Views

The byte string in python is a string presentd with letter b prefixed on it. In this article we will see how to convert a dictionary with the bytecode string into a normal dictionary which represents only strings.With decode and asciiPython string method decode() decodes the string using the codec ... Read More

Convert a string representation of list into list in Python

Pradeep Elance

Pradeep Elance

Updated on 20-May-2020 10:43:38

14K+ Views

As python handles various data types, we will come across a situation where a list will appear in form of a string. In this article we will see how to convert a string into a list.With strip and splitWe first apply the strip method to remove the square brackets and ... Read More

Convert a nested list into a flat list in Python

Pradeep Elance

Pradeep Elance

Updated on 20-May-2020 10:41:15

682 Views

A nested list is a list whose elements are lists themselves. If we have a python data container which is a nested list, we may sometimes need to convert it into a flattened list so that each element can be processed further.Even the inner elements can also be nested themselves. ... Read More

Convert a list of multiple integers into a single integer in Python

Pradeep Elance

Pradeep Elance

Updated on 20-May-2020 10:38:55

3K+ Views

Sometimes we may have a list whose elements are integers. There may be a need to combine all these elements and create a single integer out of it. In this article we will explore the ways to do that.With joinThe join method can Join all items in a tuple into ... Read More

Convert a list into tuple of lists in Python

Pradeep Elance

Pradeep Elance

Updated on 20-May-2020 10:37:15

572 Views

Converting one data container into another in python is a frequent requirement. In this article we will take a list and convert into a tuple where each element of the tuple is also a list.With tupleWe can apply the tuple function straight to the list. But we have to also ... Read More

Consecutive elements pairing in list in Python

Pradeep Elance

Pradeep Elance

Updated on 20-May-2020 10:34:18

750 Views

During data analysis using python, we may come across a need to pair-up the consecutive elements of a list. In this article we will see the various ways to achieve this.With index and rangeWe will design an expression to put the consecutive indexes of the list elements together. And then ... Read More

Consecutive element maximum product in Python

Pradeep Elance

Pradeep Elance

Updated on 20-May-2020 10:31:06

327 Views

Python has great libraries to manipulate data. We may come across a need to find the maximum product of two consecutive numbers which are part of the big string. In this article we will see the ways to achieve that.With zip and maxWe convert the string into a list. Then ... Read More

Advertisements