Most voted "list" questions
A list is an abstract type of data that represents a sequence of values, in which the same value can occur more than once. The main ways to implement a list is through an array (array, vector or one-dimensional matrix) or a chained list.
Learn more…1,022 questions
Sort by count of
-
3
votes1
answer79
viewsAdding to a list itself. What happens?
l1 = [1, 2, 3] l2 = l1 l1.append(l2) print(l1) Why does this algorithm return a three-point list? What does this new list mean?
-
3
votes2
answers192
viewsAm I required to set the size of a Linkedlist in Java?
Since the LinkedList in Java is a double chained list, I understand that I could insert an element in any index I wanted, right? Or wrong? For example, I create a list and use the method add(indice,…
-
3
votes1
answer42
viewsGraph generation error in R
Hello, I’m trying to create a chart from a list, but I’m not getting it. The download part works perfectly: # download adj. price data - Asset[1],Asset[2]... symbols= c("TIET4.SA","BVMF3.SA",…
-
3
votes1
answer1119
viewsConcatenation of lists in Haskell eliminating repetitions
Hello, it’s been a few hours that I’m trying to make a function in Haskell that gives two lists and returns a new list Where this new list is the union of the other two lists but without repetitions…
-
3
votes2
answers124
viewsLANGUAGE R: Error "Error in course[[1:98]] : recursive indexing failed at level 2" when trying to search the items in a list, how do I resolve?
I have a "course" list in R, it consists of 98 items, each item has one or two variables of type Character. I want all the first variables of each item in the list, but when typing the command:…
-
3
votes1
answer207
viewsXamarin - Picker View with list
I’m creating an app with Xamarin Forms and I came across a problem. In one of my Views I need to have an element filled with a list coming from a web service. In this case, in my Viewmodel I managed…
-
3
votes4
answers4102
viewsHow to return the values of a List<> in C#
I have a class Funcionario which has as attributes: CPF, Nome and Salario. I have to create an X amount of instances of this class in a List<> and after that, return to the user the values of…
-
3
votes3
answers171
viewsDoes the function not return the minimum value?
Make a Python function call min_max(t), which receives a list of numbers, and returns another list containing respectively the lowest and highest value of the original list. Follow the code so far:…
-
3
votes4
answers167
viewsHow to return the first vowel of several words in a list?
The code is partially done, but it returns only the vowels found in each word. How could I return only the first vowel of each word? palavras = ('boi', 'vaca', 'macaco', 'ovelha', 'lesma',) vogais =…
-
3
votes2
answers724
viewsConcatenate variables in the Django template
Talk guys, good morning, I have a problem. I’m walking through a lista but I want to concatenar my list I’m calling on template as {{ list }} and {{ forloop.counter0 }} so that in mine is only…
python django list django-templates string-concatenationasked 6 years, 1 month ago Raphael Melo De Lima 461 -
3
votes1
answer4757
viewsCompare two lists of objects and pick only the different ones
I’m having trouble comparing two lists of the same kind List<Produto> in my product class I have the following structure. public class Product { public int IdProduct { get; set; } public…
-
3
votes1
answer1815
viewsDifferences between list, tuple and set
I know that in Python there are three structures that apparently resemble each other, but that in the background there are differences. They are: list, tuple and set. List a = [1, 2, 3, 4] Tuple a =…
-
3
votes1
answer162
viewsDoubts Python Matrices
I am trying to create a function that returns the "minor complementary" matrix of any matrix. That is, given an array for example: mat=[[1,2,3],[4,5,6],[7,8,9]] The minor complement associated with…
-
3
votes2
answers4333
viewslist, max/min in python
Hello, I need to make a python algorithm that reads a text file .csv which contains literally 5 million numbers and I need this algorithm to tell me which is the smallest and which is the largest…
-
3
votes1
answer217
viewsHow to use denial in Contains c# with LINQ?
I need help, I’m starting in development, eclistIds returns me two ids, and if I don’t use the negation ( ! ) it returns me the id I don’t want, when I use the negation to return the other id,…
-
3
votes1
answer84
viewsQuickly access exact element instance within List java
I have a list that will be filled with many points (x, y, z) - about 3000. Each point is unique within the list (no repeated points). At some point my program needs to recover the instance of a…
-
3
votes1
answer508
viewsHow to know if there is an element in a List index without error?
I’m trying to give a get() in the indices of a ArrayList, so that if there is something in those positions, I add that value with something else. Only if there is no such index, I would add it.…
-
3
votes1
answer1343
viewsThe Truth value of a Series is ambiguous. Use a.Empty, a.bool(), a.item(), a.any() or a.all()
I am a layperson in programming, in the stackoverflow community and I am not able to solve the following problem: Create two lists (or if you prefer 2 columns in a New Dataframe) in which you search…
-
3
votes2
answers339
viewsHow to remove an object from a list during an iteration over the list itself
I need to remove an item from a list during an iteration over the list itself. The reason to remove during the loop is that if this item remains may end up triggering other triggers within the loop…
-
3
votes3
answers183
viewsRemove repeated elements using two lists
How would you remove without using collections and while, only with for. I wanted a search structure element by element, because I already know how to remove this way. So I want to use at least two…
-
3
votes1
answer179
viewsPrinting tabular form lists with generators
I have a list that represents 5 one-month periods with 31 days, and each period contains daily target values for a retail seller. Only for elucidation purposes would the empty structure be like…
-
3
votes2
answers515
viewsJava 8 stream - performance improvement
I am implemented a method that receives an integer value k (representing the amount of "vacancies") and two lists (p and q) of Integer and perform some operations. Using stream, check which elements…
-
3
votes2
answers852
viewsInsert elements in the correct position in an ordered list
I wonder why this code does not work for the exercise below, because when it comes to the values that will be intermediate in the list, they end up being reversed (the example I used to test if it…
-
3
votes1
answer177
viewsPython List Invert Values
I am trying to invert two values within a nested list. Example: In the list list there are two values [[1,11],[2,22],[3,33],[4,44]] and would like to reverse the values for…
-
3
votes3
answers713
viewsCombination of two lists in Python
I need a code that discovers possible passwords in a universe of LLLDDD (L=letter, d=digit), I found it easier to apply the conditions separately and I arrived at two lists: lpossiveis:['ABD',…
-
3
votes2
answers119
viewsSearch an array (list list)
Write a function called busca that receives a matrix (each row of the matrix has four entries, representing the information related to name, registration, sector and phone) and do a search by…
-
3
votes1
answer79
viewsWhy does changing items from a list with multiple assignment not work when I use "index()" inline in assignment?
I can swap a and b with this code: lista = ['a', 'b', 'c'] item = 'a' # itens que quero localizar e trocar outro_item = 'b' # indice_item = lista.index(item) # obtenho a posição de ambos…
-
3
votes1
answer60
viewsHow do I create a list to save countless Numbers generated by my function in R?
Good evening dear friends! I created a script that generates several age pyramids simultaneously. In this case, the great advantage is to generate hundreds, or even thousands of pyramids in a few…
-
3
votes2
answers102
viewsMy code is only returning half of what it should
I’m doing some simple exercises in Python and this code should return a list organized by the size of the fruit name, with the fruit with the shortest name first (in case, 'uva'). lista = ['maça',…
-
3
votes1
answer39
viewsHow to delete several elements from a list() at once in R?
I have the following list: x <- list("1", 1, 2, 2.1, TRUE, "yes", "necessary", 31, FALSE, "FALSE") would like to exclude from it all the elements which NAY are whole numbers and not characters,…
-
3
votes0
answers54
viewsAttempt to compare values from a list in a function does not generate the expected result
I have a function that receives a list and inside it a loop of repetition in order to go through all the positions and compare the value of that particular position with the value that comes by…
-
2
votes1
answer147
viewsReset View object list even with Hiddenfield
public ComprasOrdemCompras GetToCreate(ComprasOrdemCompras model, int EmpresaId) { ComprasOrdemComprasProduto clsPedidoProduto = new ComprasOrdemComprasProduto(); //Preenchi meu produto INÍCIO //…
-
2
votes2
answers4318
viewsHow to save or reserve a list of objects? (R)
In R, I’m wanting to "keep a list of matrices". In fact, I’m wanting to reserve a list of 10 objects, where each object will turn into an array, after using a for() Something like that: Data <-…
-
2
votes2
answers1417
viewsHigher frequency of a string
I have a text where I am treating several things. Now I need to get the 3 words that are most repeated in the entire text. How can I do this? What is the best solution? I thought about storing in a…
-
2
votes2
answers548
views -
2
votes1
answer334
viewslast item of the <li> list is not down even if you have space
I’m making a very simple site in HTML5 and pure CSS So I created an inline-block list of 4 items and each item is a large square whose sizes have to align to the header and such. The problem is that…
-
2
votes1
answer1071
viewsHow to view if there are two identical items in Arraylist and remove them?
I am doing the "Tokenization" of a TXT file. I need the code to hold all the tokens in an Arraylist, but can’t get any token duplicate. I would like to know how to remove tokens duplicates, or…
-
2
votes1
answer921
viewsError while printing chained list
Hello, I have an error in the function that prints a chained list. I think the error is in the print function’s for, but I may also be saving the address of prox wrongly. Follows the code: /* *…
-
2
votes2
answers1432
viewsDistribute <li> list in 3 columns
I’m trying to create a list with 5 blocks, 4 230X140px and 1 250X280px , but they don’t align side-by-side correctly, they’re like this: I wish they’d stay that way: codes: HTML <ul> <li…
-
2
votes2
answers7557
viewsHow to Save Read Chained List in File?
I’m a beginner in programming and I’m coding this program for a college job. It is a "pizzeria manager", I need to save read a linked list (customer registration) in a file, so that the data is not…
-
2
votes1
answer2885
viewsJava 8 - Collecting elements from a list
Good morning. I would like to collect specific elements from a list. I could do the Java 7 style, but I’m curious to know how I would do in the Java 8 style. For example: [[1, 2, 3], [1, 2, 3], [4,…
-
2
votes1
answer1012
viewsGet items from a List<String> - ASP.NET
I am beginner in ASP.NET development with C# and, I have the following question: When loading a page, I run a method that fills a Dropdownlist. This Dropdownlist is part of a form and, after it is…
-
2
votes2
answers116
viewsFormat columns - select specific information
Dear users, I have a large file with the following columns chr10_46938 EXON=28/28 STRAND=-1 ENSP=ENSGALP00000004070 SIFT=tolerated(0.38) chr10_46966 EXON=28/28 STRAND=-1…
-
2
votes1
answer292
viewsCollect data from a Jtable and send to a List
In my Java application, I have a sales screen where the products that are selected go to a JTable. At the end of the sale, I need to collect data from JTable and deliver to the printing method,…
-
2
votes1
answer194
viewsList coming with null value
Well, the thing is, I have three methods that are called init() of my Bean, only one works and the other 2 comes as null, I’ve already debugged and in my Product the data is correct, but when I…
-
2
votes1
answer2242
viewsHow to scroll through a list in Prolog to find a specific item
I am a beginner in Prolog and I have doubts about how to go through a list. I have a predicate historico(ra,[i1,i2,i3,...,in]) where ra is the Academic Record of a student and each i is an item,…
-
2
votes1
answer349
viewsList of random numbers without repetition Android
I have an Arraylist with N items inside and I need to randomly group them into 2 sets of X items and the rest into another set. But none of them can repeat themselves. For example: my Arraylist has…
-
2
votes2
answers271
viewsList with large amount of items, excessive memory consumption
In my system I have a List<object>, While using the system I add items to it until I get to a certain point that the system starts to lock, to get very slow. My system can add up to forty…
-
2
votes1
answer4199
viewsHow to stop a loop using the input provided by the user?
I’m writing a program that receives entries and creates a dictionary from them. I need the loop I use to insert the entries in the dictionary to be broken when the entry is "9999", but it is not…
-
2
votes3
answers8611
viewsHow to browse lists?
I wanted a solution to go through a practical list. You don’t need to show any results as I will need to scroll through a list of people (objects) and generate accounts receivable from each one, but…