Category "list"

How to add items to a list of lists

I aim to print a list of lists containing entry and exit times in the 24 hour decimal format from the "AM"-"PM" String format input by the user as a String arra

Python help on TKinter

i'm trying to make an brick destroyer game on python with TKinter for my school project, it's barely finished but i have a problem when it's about to break some

How to remove Duplicated elements from a List based on Two properties using Java 8 streams?

I'm trying to figure out how to write a stream in Java 8 that removes duplicate records based on a property and a condition, for example: +----+----------------

remove duplicates from 2d lists regardless of order [duplicate]

I have a 2d list a = [[1, 2], [1, 3], [2, 1], [2, 3], [3, 1], [3, 2]] How can I get the result: result = [[1,2],[1,3],[2,3]] Where dupli

Read text file and look for certain words from key word list

I am new to Python, and I am trying to build a script where I import text_file_1 that contains a body of text. I want the script to read the body of text, and l

Performance between Iterating through IEnumerable<T> and List<T>

Today, I faced a problem with performance while iterating through a list of items. After done some diagnostic, I finally figured out the reason which slowed dow

Extracting all matrices out of a nested list with varying sublist lengths in R

I have a nested list of matrices. More specifically, I have a list of matrix lists, each with a variable number of matrices. I would like to extract all the mat

Check null value in a list using linq

I have a list List<OfferComparison> Comparison. I want to check if all the items have Value == null in an if condition. How can I do it with linq? publ

sort nested list data in python

I am trying to sort a nested list in python(3.8.5). I have a list like - [['1', 'A', 2, 5, 45, 10], ['2', 'B', 8, 15, 65, 20], ['3', 'C', 32, 35, 25, 140], [

How to sort list of tuples based on variable in tuple

Given a list of tuples in this format (item,[dependency, priority]) where the first element indicates an item, and the first element of the second indicates a d

Can't multiply sequence by non-int of type 'float' ERROR when trying to multiply a float number with len(list)

I'm trying to take a random sample from a list given SPLIT_SIZE = 0.9, but I'm having the following error: TypeError: can't multiply sequence by non-int of type

Flutter; replace item in list

I have a list in my app. It containe a couple of items. I want to replace every item that is equal to a user-input(A String) , with another user-input(Another S

Is there any way to get all ookla server list and store this into a data base?

i wanted to insert all available ookla servers into my data base for the speed test purpose for my android application. But i am not getting any way to find out

Slicing list of lists in Python

I need to slice a list of lists: A = [[1,2,3,4,5],[1,2,3,4,5],[1,2,3,4,5]] idx = slice(0,4) B = A[:][idx] The code above isn't giving me the right output. What

Print next element of a list, if it matches the previous element

I have a list with similar elements, and I want to print the next element if I match the previous one. So something like this: my_list=['one', 'two', 'one', 'o

excel/vba: count number of unique male and female students in list

I have a database of students with names and their gender, however the list contains repeats of students on different dates. How do I count the number of uniqu

How to check if a list partially matches one of the lists in a list of lists?

I would like to check if a list is a sublist if a bigger list of lists. It would be easy to check if it is just in the list of lists but a partial match is also

How to check if a list partially matches one of the lists in a list of lists?

I would like to check if a list is a sublist if a bigger list of lists. It would be easy to check if it is just in the list of lists but a partial match is also

finding and replacing elements in a multidimensional list (python)

Similar to this question: finding and replacing elements in a list (python) but with a multi-dimensional array. For example, I want to replace all the N's with

In Python, how to numerically sum nested lists of integers: [[1,0], [1,1], [1,0]] → [3,1]

I have an array in the form of a = [[1, 0], [1, 1], [0, 0], [0, 1], [1, 0]] and I need to sum all values of the same index in the nested lists so that the ab