Questions tagged [list]

The list tag may refer to: a linked list (an ordered set of nodes, each referencing its successor), or a form of dynamic array. Not to be used for HTML lists, use [html-lists] instead.

131,414 questions
0votes
0answers
19views

Compare two list of dictionaries and get difference

I am new to python. In Python, I want to compare two list of dictionaries Below are 2 list of dictionary I want to compare based on key which is "zrepcode" and id which is the number "1&...
0votes
0answers
15views

I need to get list with an argument

private fun getRadResultList() { safeLet( arguments?.getString("referenceVisitId"), arguments?.getString("facilityId") ) { referenceVisitId, facilityId -> ...
-1votes
0answers
11views

How I can merge certain elements of a list in Python

I have a variable that contains the following data (18 17 16 15....) I need to work with values 18, 17, 15 and etc but after transferring to the list I have ['1', '8', '', '1', '7', ''.....] how can I ...
0votes
1answer
17views

Create array from randomly extracted data from array of arrays

Suppose that I have the following array or arrays: [[0, 1, 2, 3, 4, 5, 6, 7, 8, 9],[0, 1, 2, 3, 4, 5],[0, 1, 2, 3, 4, 5, 6, 7]] What's the best way to loop into the main array and randomly extract ...
1vote
3answers
47views

C# - An object is deleted from an array that holds a copy of the original

I hold an array in the following structure List[] pageStore = new List[2]; Each cell of the array will contain a list of Page objects. I wrote a function that ran in a loop and in each iteration ...
0votes
0answers
12views

Create files from a list

I need to associate image files with code name for an e-commerce. I have the photo eg. IMAGE.JPG and I have a list of codes, ex: CODE1 CODE2 CODE3 do you know a method to create files from the list, ...
0votes
2answers
21views

How can I modify a specific element(which depends on another dictionary) in a list, where the list is the value of a dictionary? (python)

Given 2 dictionaries of: the students' id and how many points they've got on each problem: user_probstat_dict = {'106095014': [3, 1, 1], '106095029': [3, 1, 0], '106095033': [3, 1, 0]} the students'...
2votes
4answers
29views

Compare current element in one list to next element in another list

I have two equally long lists representing the start and end frames of an event. They look something like this: START END 111 113 118 133 145 186 The next element of the ...
0votes
1answer
21views

How to test for substrings in the list

I need to check if a string is in the list my_list. my_list = ['word1,word2,word3', 'g1,g2', 'word1'] When I run 'word2' in my_list, it returns False instead of True. How can I test for substrings in ...
  • 2,375
1vote
1answer
23views

I'm trying to convert a tuple to a list in python

I'm trying to turn this: ('a','b',['a1','b1','b3',('a2',('ab','bd','cd'),'b2','c2')]) into this: ('a','b',['a1','b1','b3',('a2',['ab','bd','cd'],'b2','c2')]) changing the ('ab', 'bd', 'cd') to ['ab', '...
1vote
0answers
24views

R: Accessing first three elements of splitted dataframe

For example, dateIntervals <- as.Date(c("2020-08-10", "2020-11-11", "2021-07-05")) possibleDates <- seq(as.Date("2020-01-02"), dateIntervals[3], by = &...
1vote
1answer
14views

How to replace a key value when comparing between two lists

Im currently facing and issue where I have a two list: List1: [ { 'gtin': '00195866290877', 'amount': 'LOW', 'modificationDate': '2022-06-23T09:59:27.000Z' }, { 'gtin': '...
-2votes
1answer
25views

R - reduce multilevel list and add id variable at each step

Let's say that you have a list in R named Weather which is structured like this: - Winter - Europe - Rainfall - Temperature - Asia - Rainfall - Temperature - ...
0votes
1answer
24views

How to iterate through sequential string values and append to a nested list

I have a list containing filenames of a dataset, in the form of a number followed by some descriptive text (which is different for each file): a = ['001_sometext', '002_sometext', ..., '162_sometext', ...
  • 149
1vote
1answer
25views

Pandas find value count cross tab for past 3 years

I have a dataframe like as below ID,design_id,year,category 1,21345,1978,DC 1,3456,2019,DC 1,5678,2021,DF 1,7890,2021,DC 1,5678,2021,OT 1,1357,2020,np.nan 2,9876,2021,DC 2,9865,2021,DC 2,9876,2021,DC ...

153050per page