Category "list"

Dart: why is a list or map not equal to [] and {} respectively

void main() { var a = []; var b = []; print(a == []); print(a == b); var c = ['c']; print(c == ['c']); var d = 'd'; print(d == 'd'); } fa

Dart: why is a list or map not equal to [] and {} respectively

void main() { var a = []; var b = []; print(a == []); print(a == b); var c = ['c']; print(c == ['c']); var d = 'd'; print(d == 'd'); } fa

How can I create a two dimensional array with each element being a list in Java?

I want to create a two-dimensional array, each element of which is a list, as in the image. I tried ArrayList<List<User>>[][] arrayList = new ArrayL

Get the index of the unique item only

I have a list of colors as shown in the expanded code screenshot below. The list will always have 4 color values, but only one of them will be different than ot

How to print data if only matching string found in list?

key_word = ["apple","Apple","Boy","boy"] title1 = "Where the boy" title2 = "The Boy playing cricket" title3 = "hello world" title4 = "I want to buy apple vine

How to convert the elements of a python list of lists?

I have a python list (vals) containing lists of strings like this: [['540.0 ', '0.0 ', '0.0 ', '162.0 ', '2.5 ', '1040.0 ', '676.0 ', '28 ', '79.99 \r'], ['54

printing a board in python

I'm trying to create a chess game in python without uses pygame I know I'm not so far to finish it but I have a problem, I don't achieve to print my board in a

Menu Item does not break like but pushes one word over the other when re-sizing window

It's probably something small, but I cannot figure it out. When resizing the browser window, the string in the list items don't break onto a new line. (see imag

Mean calculation between dataframes in list in R

I have a list of dataframes that all have the same format (same number of rows, same number of columns and columns have the same name). I would like to create a

Prolog: replace the nth item in the list with the first

I'd like to have a Prolog predicate that can replace the nth item in the list with the first. Example: % replace(+List,+Counter,-New List, %-First Item). ?- rep

Comparing lists with order

I wish to compare lists and output the similar matches that following each other in the same order. list1 = ['a','b', 'b', 'c'] list2 = ['b', 'a', 'a', 'c'] #

How can I implement Tail Recursion on list in Haskell to generate sublists?

I want to make the biggersort function recall itself recursively on the tail of the list. My code below works and gives me the following output : [6,7,8] I wan

Is it worth adding zeros to rows of uneven number of columns in a list of lists?

I have a working Haskell example of how to do it when we want to add zeros to the left and to the right of a list as two separate functions, and I did it becaus

Python: Compare values of two fields with multiple strings and add all unique values to a 3rd field

I am still a Python-Rookie and are stuck with an idea. I want to compare the values of Type1 with Type2 and add all unique values to a 3rd field. My demo data:

Converting PYODBC output into an int

Pulling data from a SQL query that gives me 1 number that is stored in a PYODBC row. I want to then add that number to another variable in the file. Pseudocode

How to create a dictionary, where the key is the key of a dictionary of lists and the value is the longest list

I have this dictionary of lists of dictionaries: dict_countries ={'uk': [{'datetime': '1955-10-10 17:00:00', 'city': 'chester'},{'datetime': '1956-09-10 13:00:0

How to find different items between mulitiple lists

I am trying to figure out how to compare n lists to find the different items. For example, consider the list: list_l = [[1,2,3,4,5,100], [1,2,31,41,

C#: Update List Item

public class person { public string name { get; set; } public string family { get; set; } } And I have a list of the same as Below: List<person&

Python valueError: setting an array element with a sequence, TypeError: only size-1 arrays can be converted to Python scalars on MLP

I have this dataset (shape is (36,2)). x is a numerical pattern, y is a binary class (0,1) x y [0.2, 0.3, 0.5 ..... 0.5] 0 [0.1, 0.4, 0.5 ..... 0.9] 1 and so

Add item to SharePoint list

How do I add an item from an Excel file to a SharePoint list? I cannot use Access as an additional step here. Within Excel 2019 I run a macro and part of it sho