Category "list"

Raku list addition operator `Z+` 'fails' unless one of the lists is forced

I'm struggling to understand why the zip-add Z+ operator does not work on some cases. I have some 2-element lists that I'd like to sum. These work as expected w

python list No displacement

I have a list [{'sender': '0', 'recipient': '15839597-107f-4166-aff1-ac32d3794748', 'amount': 50}] and call this list elsewhere for create sha256 but list item

How can I access and iterate through an ArrayList of Linked list element?

I am trying to write a code of adjacency list implementation of the graph ADT. private ArrayList<LinkedList<Integer>> adjLists ; but I don't know

How do you print an entire row of a list made of words?

I have simplified my question where I just have a 2x2 list of words. I'm trying to print an entire row but it evidently doesn't work the same as with a list of

How can I pass the list to the component variable in Laravel?

How can I pass the list to the component variable? I tried to add elements of a list in @php tags like this , for now,, in the future, I will fetch this list fr

error: Incompatible return value type (got "Tuple[Tuple[float, float], ...]", expected "List[Any]")

Context While trying to implement static typing, I'm experiencing some difficulties in specifying the return type of the following function: def create_hexagon_

Best way to sort BOTH prefix and suffix with custom sorting

So I have a list of codes, something like: (I.-) (I.+) (I.0) (B.+) (B.0) (B.-) ... (No value) (N/A) I was able to sort them but we have a "custom requirement" t

TypeError: descriptor 'append' for 'list' objects doesn't apply to a 'float' object

I am trying to solve a problem and trying to get input from the user and append that in a list. But i am getting this error message. if __name__ == '__main__':

Create a dictionary from one key and list of tuples

I have a list of tuples. For example: L = [(334, 269, 461, 482), (182, 178, 307, 471),(336, 268, 466, 483), (183, 177, 304, 470)] The length of the list someti

Repeating each element in a list

I have two lists: x = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] y= [5, 2, 3, 2, 3, 3, 3, 3, 5, 3] I want to create a new list that contains of multiplies x's first eleme

How to split a string in to list where the number of string in the list is defined?

So if I have a string: s = "this is just a sample string" I want to obtain a list of 3 characters each: l = ["thi", "s i", "s j", "ust", " a ", ...]

How to convert List to Map?

Recently I have conversation with a colleague about what would be the optimal way to convert List to Map in Java and if there any specific benefits of doing so.

how can I remove some NA rows but not all of them

I have multiple data frames with information about listed companies from the year 2000 So I want to put them in a list (lets call it df) because I want to do re

words amalgamation

I am new user learning python. I have query if it can be done or not. If user input a word suppose "Dance" and characters are "$" and "@", he would get a all po

displaying parent-child elements hierarchically in c#

I have a parent-child structure in my db and I want to list them hierarchically n a C# program: id text parentid 1 A NULL 2 B NULL 5 a1 1 6

How to move an Item inside a list of lists?

I have the following list of lists representing a matrix stored in space: [' ', '1', '1', ' '] [' ', '1', ' ', ' '] [' ', '1', ' ', ' '] [' ', ' ', ' ', ' '] T

How do I efficiently find which elements of a list are in another list?

I want to know which elements of list_1 are in list_2. I need the output as an ordered list of booleans. But I want to avoid for loops, because both lists have

Java 8 Streams - How to get an equivalent of partitioningBy() with Integer keys?

In the code shown below, p is a predicate of type Predicate<String>. Map<Boolean, List<String>> partitioned = numbers.stream() .collect(Co

Two ways of slicing Python nested lists

I have following code mylst is a nested list: mylst = [[507, 3, 30, 44, 522, 25], [268, 40, 23, 54, 280, 67], [424, 37, 28, 50, 438, 62], [216, 47, 24, 50, 22

Return keys from nested dictionary Python

I have a nested dictionary as such: {'needed1': {'notneeded': {'needed2': 'some_value'}, 'notneeded2': {'needed2': 'some_value'}, 'notneeded3': {'needed3: '