# Tag Archives: python-list

NumPy is the fundamental package for scientific computing in Python. NumPy arrays facilitate advanced mathematical and other types of operations on large numbers of data.… Read More
A list in Python is a linear data structure that can hold heterogeneous elements they do not require to be declared and are flexible to… Read More
Suppose we have a function and we want to compute this function for different values in a single line of code . This is where… Read More
Given a matrix with most of its elements as 0, we need to convert this matrix into a sparse matrix in Python. Example: Input: Matrix:… Read More
Given a List of Integers. The task is to convert them to List of Strings. Examples: Input: [1, 12, 15, 21, 131] Output: ['1', '12',… Read More
Lists are just like the arrays, declared in other languages. Lists need not be homogeneous always which makes it a most powerful tool in Python.… Read More
Given a list ‘L’, a sum ‘S’ and number of elements to take at a time ‘m’. The task is to find how many ways… Read More
Sometimes the code becomes an unreadable mess of hardcoded slice indices. Consider the following code which stores the details of students(Name, Phone Number, Address, Marks… Read More
Lists are just like the arrays, declared in other languages. Lists need not be homogeneous always which makes it the most powerful tool in Python.… Read More
* operator and range() in python 3.x has many uses. One of them is to initialize the list. Code : Initializing 1D-list list in Python… Read More
Given a 2D list, write a Python program to find the most common element in each column of the 2D list. Examples: Input : [[1,… Read More
Getting the length of list is quite common problem and has been dealt with and discussed many times, but sometimes, we require to better it… Read More
Yet another problem regarding the interconversion between data types is conversion of string of list to a dictionary of keys and values. This particular problem… Read More
Many times while working with numbers in data science we come across the problem in which we need to work with data science we need… Read More
Sometimes, we need to perform the conventional task of grouping some like elements to a separate list and thus forming a list of list. This… Read More