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
-
2
votes2
answers172
viewsIntersection between lists without repeating elements
I have to make a code that reads two strings of numbers, convert them into int, store in a list and print list A (first string numbers), list B (second string numbers) and list C (common numbers in…
-
2
votes3
answers63
viewsVue JS - How to display a list interspersed between property and value?
I have this list as an object: let app = new Vue({ el:'#app', data:{ lista:{ nome: 'Nome Completo', email: '[email protected]', cpf: 'xxx.xxx.xxx-xx', rg: 'x.xxx.xxx', tel: '(xx) x xxxx-xxxx' } } });…
-
2
votes1
answer107
viewsHow to load . txt files from a directory including in the list or dataframe the name of this file in Python?
I’m at Jupyter Notebook working with Python. I have a directory with files in txt, I can iterate in the directory and load these files in txt, however, I also need to take the name of this file as…
-
2
votes1
answer42
viewsFiltering a list with elements contained in another list
I have the class class estruturaPosicaoXY(val x: Float, val y: Float) {} then fill out a list of that class through the method: fun mapearXY(x: Float, y: Float): List<estruturaPosicaoXY> { val…
-
2
votes1
answer30
viewsWhen using the . extend() command in Python, how do you store the result in a new object?
Considering the lists: lista1=["a","b","c","d"] lista2=[5,6,7,8] My goal is to get a new list that has the elements of these two ['a', 'b', 'c', 'd', 5, 6, 7, 8], but preserving them the way they…
-
2
votes1
answer52
viewsPython sequence lists
I have a reference list with repeat values ex:. [1, 1, 2, 2, 2, 3, 3, 3, 3, 3, 3]. I am trying to create another list that creates an increasing sequence from the first set of data, restarting the…
-
2
votes1
answer145
viewsHow to transform an array with strings(list) into an integer array in Python?
I’m new to python programming. I came across today the challenge of picking up a vector (ex:V1== ['MESA 11 22 33 44 ']) in which all its elements are in string format (as if they were one, only…
-
2
votes1
answer32
viewsReturn the elements of a randomized list
I have an array generated by a string.split(), and the value of this string is obtained by a input. That is to say: string = input("Digite os Nomes separados por Vírgula") arrTeste =…
-
2
votes2
answers82
viewsSort two lists based on the order of the first
Let me give you an example because it’s clearer to explain: x = [7,5,9,4,2,3,8,1,10] y = ['sete', 'cinco', 'nove', 'quatro', 'dois', 'tres', 'oito', 'um', 'seis', 'dez'] I need to sort the list x,…
-
2
votes2
answers91
viewsHow do iterators created from lists rescue "random" values in Python?
I’m studying iterators and generators in Python, and I was intrigued by a question, and I can’t find the answer to that anywhere. When we create a Python generator through a generating expression…
-
2
votes1
answer45
viewsTransform a list (list) into a database (data.frame)
I have the list below. I would like to turn it into a data.frame (or Tibble): dados.lista <- list(id = 2287276L, uri = "https://dadosabertos.camara.leg.br/api/v2/proposicoes/2287276", siglaTipo =…
-
2
votes4
answers177
viewsInsert names to a list depending on their value
I’m trying to make a draw code, the user inserts the value to be donated and your name. Let’s assume that Bia donates 10 real, Bia’s name has to appear 1 time on the list. And let’s assume that…
-
2
votes2
answers86
viewsHow to deal cards from a deck using dictionary
I have the following dictionary composed of a list of its values: baralho = { 'Paus': ['Ás',2,3,4,5,6,7,8,9,10,'Dama','Valete','Reis'] , 'Ouros': ['Ás',2,3,4,5,6,7,8,9,10,'Dama','Valete','Reis'] ,…
-
2
votes1
answer39
viewsLogical error while removing repeated items from a list
I am doing an exercise where I must create a function that removes repeated items from a list and returns this ordered list. My code removes only a few repeated items, but leaves others. I know…
-
1
votes1
answer73
viewsIs it possible to create an Std::list with an initializer_list?
I’d like to pass one std::list temporary to a function, but do not know if it is possible to do it. I know it is possible to pass a std::vector temporary with a initializer_list: #include…
-
1
votes1
answer1440
viewsRecursive function to end a list
I want to do a recursive function to offset the memory of each block in the list, but when I print it after using the function, it loops and memory addresses are printed when asked to print (the…
-
1
votes1
answer75
views -
1
votes1
answer83
viewsscroll rotates and stops at the div below
I’m developing a website and I’m having a problem. I want to create the website presented some products, and I want to scroll the scroll, the site runs to a certain size stopping in the position I…
-
1
votes0
answers112
viewsBizarre bug in player only happens on Chrome
I’m making a site with music playlist everything works fine on my pc on all browsers, but when I go up to the server, something bizarre happens, where only on google Core after I play 6 songs no…
-
1
votes1
answer110
viewsAssociating List<T> with Webclient
How to associate a class List to a Webclient, and at its end calls another Webclient in a index different List< WebClient > clients; void BaixarTudo(List< string > urls){ for(int i=0;i…
-
1
votes1
answer1094
viewsMusic playlist with Pause and play
Hello, I need to make a music playlist with Html5 in my researches I found many playlist, but, none of them have pause in the playlist itself. For example, I found this link…
-
1
votes1
answer426
viewsInsert sub-list C
Hello, I’m having a hard time working with chained sublists. I would like to know the correct way to insert a sublist in a list. I have declared the lists as follows:: struct Casa { int…
-
1
votes1
answer129
viewsHelp with Arraylist
Only the last two elements of my Arraylist are sent as datasource in ireport. I have an Arraylist that stores read tag data in xml files. For example, I select three xml files with the same tags but…
-
1
votes0
answers105
viewsProblem with List and Hashmap
I have a list as stated below: List<Map<String, String>> lista = new ArrayList<Map<String, String>>(); Map as declared below: Map<String, String> mapa = new…
-
1
votes1
answer1200
viewsObtaining data from excel and turning it into a list by Python
import xlrd def ler_arquivo(teste_termal1): tt1= xlrd.open_workbook('teste_termal1.xls', formatting_info=True) eajp60= workbook_r.sheet_by_index(3) Coluna_4=[3] Coluna_13=[12] return {…
-
1
votes2
answers1154
viewsHow can I order a Linkedlist?
So like I said in the title I need to order a LinkedList of an object and these objects as a sort parameter. Follows the code: public LinkedList getOrderOfActivityCompletion() {…
-
1
votes1
answer2956
viewsManipulate list and add list items in Prolog
I’m a beginner in Prolog and I have doubts about the list manipulation and the sum of its items. I have a predicate historico(RA,[i1,i2,i3,...,in]) where ra is the Academic Record of a student and…
-
1
votes4
answers1242
viewsHow can I save a list or export a list object in R?
I have a list object, similar to the one below: x<- list(cod = 1:10, taxa = exp(-3:3), logico = c(TRUE,FALSE,FALSE,TRUE)) What is the best way to store this object, in *.R , *.csv or _ _ _ ?…
-
1
votes2
answers230
viewsHow to implement and use the Binarysearch method?
How to implement and use the method BinarySearch of a List<T>? I’m having difficulty implementing and also how to use it in a practical way. Follow the example for illustration: int…
-
1
votes1
answer450
viewsShow mailing list with Tkinter
I’m doing a show in Tkinter that’s based on an e-mail box. I intend, in a Tkinter window to show an email list based on a directory with files .txt ( which are emails). I have been looking for a…
-
1
votes1
answer119
viewsHow to block the insertion of information using a List
Well I’m using list structure and I’ve tried everything and so far I can’t. I am trying to get the product entity to receive ONLY the CPF from a vendor. The entity Product works when the entity…
-
1
votes1
answer886
viewsCreate a list of python Dict
I have the following python function def playersID(self, listDetals): listPlayersID = [] tempDict = {} for x in listDetals: for y in x['result']['players']: tempDict.clear() tempDict['match_id'] =…
-
1
votes1
answer5079
viewsHow to merge an array?
I am writing a program that merges the values of two arrays, with the same amount of values. The program receives as input amount of values in each array. It then takes the values and at the end…
-
1
votes3
answers2971
views -
1
votes2
answers78
views -
1
votes2
answers74
viewsChoosing an index from a list
I have a list: l = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15] I would like to choose a value between the indexes 6 and 14 of this list, but do this 5 times and store these values in another…
-
1
votes1
answer1141
viewsVariable with multiple lists for matrix
Good night. I have a text file where I have already converted your content to lists. Each line in the file has become a list[], but now I need these lists to be all within an array. This way I can’t…
-
1
votes0
answers110
viewsHow to handle iframes on a list?
I’m trying to group a series of Youtube videos on my personal blog, all videos are inside an iframe tag, for example: <iframe class="YTvideo" allowfullscreen="" frameborder="0" height="344"…
-
1
votes1
answer2870
viewsPrint a list of objects as string in Python
I am making a program in python(2,7) where I take texts from a file,and storing as objects in a list, I would like to print the list but only returns the addresses, I am learning to program in…
-
1
votes2
answers1616
viewsLocating Object in a List
I have the following objects public class Passo { private Long id; private Date dataAtend; private Time horaRealizada; private Long idProfissionalRealizador; private String Descricao; /*getter &…
-
1
votes0
answers499
viewsHow to list download links by VBA
Hello! My problem is this... I am doing the access to a site, where I provide login and password and travel through the pages to my page of interest. I have a feature that always lists all links on…
-
1
votes0
answers39
viewsUsing two Resultset + Userlist
I’m doing two distinct database searches that will return various data that will be entered in a list. I need to create a single list with this data. And the queries must concatenate with each…
-
1
votes1
answer972
viewsSend list of JSON c#objects
Well, next, I’m trying to send a list of objects through JSON to a C#controller, where it contains an object Answer, and in that object, contains another call Field. However, in the controller, I…
-
1
votes1
answer1419
viewsAccess a specific row and column from a C#list
How do I make a multidimensional list, and that I can add elements like this: List<List<String>> listaMultidimensional = new List<List<string>>();…
-
1
votes3
answers1667
viewsAvoid duplicated list data
I need a list of musicians without repetitions, however it is bringing duplicate values, according to the amount of songs that each Musician has, how do I to be brought only one Musician? public…
-
1
votes2
answers287
viewsCreate product classes and photos and initialize
I have a class Produto and within that class I have a class Categoria and a Class Foto. 1 Product may have only 1 category, but may have multiple Photos. The problem is with the photos. I did so:…
-
1
votes2
answers799
viewsTypeerror - 'int' Object has no attribute '__getitem__' when iterating over list
Problem: Write a function that accepts a list of integers and returns a list that is the drawn (ascending) version of the original list.(Original list should not be modified). You cannot use the…
-
1
votes1
answer175
viewsHelp with list and file
Well, I need to pass a chained list to a file and I did a function for it but I can’t. Besides I’ve done several tests and I couldn’t. #include <stdio.h> #include <stdlib.h> typedef…
-
1
votes1
answer5121
viewsC# - How to add results from a SELECT to a List and use the list to Popular a Table
Everything all right? I’m new in C# and I’m stuck in a little problem with a project in Visual Studio: I am developing a project with DAO standard (DATA ACCESS OBJETC). I have an interface…
-
1
votes2
answers811
viewsHow to create sublists with numerical elements that are in a sequence?
Friends, imagine a list: lista = [1, 2, 2, 3, 3, 3, 6, 6, 7, 11, 12, 12, 13, 14, 14] Could I create sublists only with the elements that are in sequence? For example, in this case it would be: lista…