Category "list"

python 3 how to generate multiple random element in list for loops

I'm doing a coding exercise and it's to build a password generator. I understand I need to utilize the for loop with the list containing the elements but I'm ha

How to merge two lists using LINQ Suming especifics fields with sublists

Considering I have 2 list (listaProduto1 and listaProduto2), both with same properties, but with different values. I need the result merge both lists, but it mu

Subset with only consecutive numbers

I want to generate all subset of {1,2,3,4} with only consecutive numbers. (For example I want subset {1}, {1,2} or {2,3,4} but not {2,4}. ) This is what I have

how to create a dataframe from a list of dictionary value?

I have a list - elements_listed = [{'data': {'data/2022/04/1': '26-Apr-2022 07:47', 'data/2022/04/2': '24-Apr-2022 17:27', 'data/2022/04/3': '22-Apr-2022 14:20'

Removing Custom-Defined Words from List - Python

I have a dataframe column that looks like: I'm looking into removing special characters. I' hoping to attach the tags (in list of lists) so that I can append t

tail recursion count, split & get the prefix of a list functions

Language: Scala I'm working on some tail recursion questions in Scala. (GOAL) A function that counts the number of ones in a list. The function takes a list of

How to convert rows under a column into a list under a dictionary under a list under a dictionary?

I have an excel file with the below column name as variantID and corresponding elements. I want the final output as {"filters":[{"tags":[{"k":201,"v":"201"},{"k

How can I set one array as a value of another array in PHP? [duplicate]

I have the following array: Array ( [0] => James [1] => Mike [2] => Liam [3] => Shantel [4] => Harry ) Arra

Memory issues with a list of lists [closed]

I am having some memory issues and I am wondering if there is any way I can free up some memory in the code below. I have tried using a genera

values keep piling append function python

i have a list li_LBF which has 287 list inside it..i want calculate the Euclidean Distance between every list..but my code not working...the list where i am try

How replace all these "if...elif...else" statements with something more concise?

Is there a way to reduce the amount of elif things in my statement? In another question I asked someone said that my code suffered from redundancy and it defini

C++ : How to create a copy constructor of array that has a pointer?

I have template <class T> class arrList: public linearList<T> { public: arrList() {} arrList(const arrList<T>& List); ~

Kaprekar's constant (sorted(numbers) [duplicate]

Okay I've broken down step by step what the function needs to do. create random number, sort ascending and descending(needs both), subtract, s

(FLUTTER) --- RangeError (index): Invalid value: Valid value range is empty: 0

Row( mainAxisAlignment: MainAxisAlignment.center, children: [ Padding( padding: const EdgeInsets.all(8.0), child: Icon( password[0] == null ? unchangedPassword

How to count an element that exceed our criteria in a list that is in a list that is also in a list (a list with a depth of 4 lists (?))?

I'm trying to count how many element that is exceed some criteria (for exemple: 0.7) and then convert them into percent, the element is in a multiple list that

Using a keyword between list names to apply a function between elements

I have a list l1 that have file names for each of the list elements. I also have a second list l2, that have some of the same components in the names of the lis

Using add_header_row from flextable to create columns of varying widths

I have data as follows: dat <- structure(list(rn = c("type_A", "type_B", "type_C" ), freq = list(c(0, 0, 0, 5, 7, 16, 28), c(2, 1, 0, 5, 0, 8), c(0, 0,

How do I iterate over two lists?

I have troubles in using for loops in Python. I wrote this code: x=5 people=['Mary','Joe'] genders=['she','he'] for person in people: print(person) for

python - mpltPath.Path(polygon).contains_points(points)

I have a list of polygon's corners points (polygon) and a list of x,y points (points). when I do mpltPath.Path(polygon).contains_points(points) I get a list of

Check if string exists in list made with data from a csv file

I import data from a csv file and then store it in a list (List<Customer> customers). The data is added to the list by creating and adding objects. The ob