Category "list"

Iterating through list of lists of lists

I am trying to iterate through a 3-D list in python(not numpy but I am willing to convert to a numpy array if this makes it easier) in such a way that from a li

How to change array rows places whithouth numpy

Hello everyone here is my code: n =[[34,2,55,24,22],[31,22,4,7,333],[87,74,44,12,48]] for r in n: for c in r: print(c,end = " ") print() sums=[]

Is there a way to initialize or modify a list that allows to reference previous values?

I want to store non-rectangular data in a structure, e.g. in a list. Referencing previous data works using a tibble, e.g. like this: dat <- tibble(a = 2,

a python console application executed from within vscode integrated terminal not allowing arrow keys to select list items

I have a file samlapi.py. Running the file pops up a dialog with a list of menu items on the terminal to select from. I cannot traverse the menu items using key

Problems with input values to a list

I'm quite new at this and I have a problem. I want to read an input and store it at a list, for example: 2 -> number of trees that will be formed after this

splitting strings by list of separators irrespective of order

I have a string text and a list names I want to split text every time an element of names occurs. text = 'Monika goes shopping. Then she rides bike. Mike likes

Use a list with function names to iteratively apply over a dataframe column

Context: I'm allowing a user to add specific methods for a cleaning process pipeline (appended to a main list with all the methods chosen). Each element from th

Entry-wise domination of vectors

I have several list of reals in [0,1] of identical size. For instance: [0.33, 0.0, 0.0, 0.33, 0.33, 0.33, 0.0] [0.0, 0.33, 0.0, 0.33, 0.33, 0.33, 0.0] [0.0, 0.3

Excel Single Use Dropdownlist

My problem is the following. I have two tables. The first table is a guest list where the information on who is the guest and how many beds he need is stored. S

map function based on a column value of dataframes stored in a list

I am trying to use the map function to do something complex - I'd like to use the values of the Result column per each dataframe I have in a list ( these are m

What's the fastest way of finding a random index in a Python list, a large number of times?

What's the best (fastest) way of extracting a random value from a list, a large number (>1M) of times? I am currently in a situation where I have a graph rep

Iterate over lists inside a dictionary

Is there any way to iterate over lists inside a dictionary. A key inside dictionary contains a list which needs to be iterated over separately from the other li

Selecting elements from list based on length in R

I have this list of ~270'000 elements with each element having a length of either 165 or 166. What I would like is to isolate into a separate dataset those elem

use function to the items in list

originally, beaker is instance and the function below is possible. beaker.replace(z=10) I made a list of beakers bk = [beaker1, beaker2, beaker3] and I want al

How to use Map.computeIfAbsent() in a stream?

I have a fun puzzler. Say I have a list of String values: ["A", "B", "C"] Then I have to query another system for a Map<User, Long> of users with an attr

How to append a multiple dictionaries to a list from a loop, python?

How can one append dictionaries that each looping generates to a list so at the end my function returns a list of n-dictionaries? Without any fancy libraries, j

List changed in a function [duplicate]

I'm supposed to rotate the list iteratively which means put the first element to the last, and the rest move forward until it back to the orig

How to take a tuple of two lists from user input?

How to take a tuple of two equal-size lists from user input at a bash terminal from within a python script? Let's assume we want the program to register the fol

Proving a simple list function applied four times is the identity

The following video contains a mathematical card trick due to Colm Mulcahy: https://www.youtube.com/watch?v=dHzUQnRjbuM The key operation in the trick is define

How to use grep to search for patterns matches within a list of data frames using a second list of character vectors in R

I have two lists in R. One is a list of data frames with rows that contain strings (List 1). The other is a list (of the same length) of characters (List 2). I