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.
25
questions
0
votes
3
answers
31
views
How to call a number from a multi-dimensional complex list
I'm trying to make a sophisticated quiz that involves a list for a question and an answer that is included in a list. I want to call numbers from this multi-dimensional list using a "for" ...
0
votes
0
answers
39
views
Difference between appending a list and appending a copy of list [duplicate]
I need to understand the difference between appending a list and appending the copy of a list in python.
This is the code:
res=[1,2,3]
res1=[1,2,3]
c1=[5]
res.append(c1.copy())
res1.append(c1)
print(...
-1
votes
5
answers
50
views
Focusing on an element of a subset, of a subset
Fairly new to coding and I have a question regarding list and subsets.
Suppose this is my list:
list =
[[[a,2], [c,3], [e,3]],
[[g,4], [i,4] [k,3]],
[[b,3], [d,2], [f,2]]]
How would I go about making ...
0
votes
1
answer
42
views
List of controlled components in React
I am trying to have a list of components where each one takes user input and have a separate state.
I want then to be able to filter this list and get the components where for example "switch&...
2
votes
2
answers
40
views
How to match elements from input to list
I'm currently working on a Caesar cipher program, and I basically typed up a list of the alphabets: alphabet = ['a','b','c','d',...]
Then asked the user for a word to encrypt, text = input('Enter your ...
3
votes
0
answers
46
views
How do I iterate over a sublist of a SynchronizedList in Java?
What kind of synchronization should I use to iterate over a sublist returned from a SynchronizedList as a result of subList() method invocation?
The documentation for Collections.synchronizedList() ...
0
votes
0
answers
28
views
Navbar list items being disrupted with image [closed]
Need some help on why my links aren't positioned where they should be.
Only the :first-child seems to be aligned where it should.
* {
margin: 0;
padding: 0;
}
body {
min-height: 100vh;
...
0
votes
0
answers
17
views
How to completely fill a Section (or use a custom shape for a Section) in an .insetGrouped List? [duplicate]
Given a List with insetGrouped listStyle, how can I fill the contents of a Section such that no padding is visible?
In the follow example, I have a Rectangle overlaid with a Button. The Rectangle (in ...
2
votes
1
answer
81
views
codatatypes and least predicates in Dafny. Does it make any sense?
I am trying to deal with infinite lists as follows:
codatatype iList = iCons(head: int, tail: iList)
least predicate isIn(e: int, l: iList)
{
e == l.head || isIn(e, l.tail)
}
least predicate ...
0
votes
1
answer
22
views
Python scipy integrate.quad with TypeError: 'NoneType' object is not iterable
I am trying to define the following integral using scipy:
and here is my code:
import numpy as np
import scipy.integrate as integrate
from scipy.stats import norm
def integrand(xi, thetai, *theta):
...
1
vote
2
answers
26
views
How to get the probability data from survfit function?
I plot cumulative incidence curves based on data from the survival::survfit() function. Following this vignette I do something like the following:
library(survival)
mgus2$etime <- with(mgus2, ...
4
votes
5
answers
49
views
How to transfer dataframe `raw_df` to `list` row by row?
How to transfer data frame raw_df to list row by row? Desired output: wished_list
raw_df <- data.frame(cat=c('a','b','c'),value=c('high','mid','low'))
wished_list <- list(a='high',b='mid',c='...
0
votes
2
answers
36
views
How to update list value according given value
In below mlist object, how does one update the value to 'character' for all elements which currently are c("ordered", "factor")?
library(tidyverse)
mlist <- sapply(diamonds,...
0
votes
1
answer
30
views
MySQL giving me 4 rows,there should be one,I don't know
I'm a beginner apprentice. I don't know why my code is returning extra duplicate rows.
Code:
SELECT *
FROM employees
It returns the list, but repeated multiple times and the first number on the ...
0
votes
0
answers
23
views
Moving element from the list to the top of the screen in Flutter
Im interested in making a list of elements in which if I press any element it will expand and move to the top of the parent widget (in my case I use scaffold). In other words im looking for a way to ...