Category "list"

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

How to create a list of all elements present in a single cell of a dataframe?

Let say I have a dataframe: now i want list of the elements present in the column NAME like this: ['s', 'a', 'c', 'h', 'i', 'n'] how can we do this in pyspark

How can I iterate through two lists in parallel?

I have two iterables in Python, and I want to go over them in pairs: foo = (1, 2, 3) bar = (4, 5, 6) for (f, b) in some_iterator(foo, bar): print("f: ", f,

Differences between IQueryable, List, IEnumerator?

I am wondering what the difference between IQueryable, List, IEnumerator is and when I should use each one? For instance when using Linq to SQL I would do some

How can I i get the same result as shown on the docstring

def make_str_from_row(board, row_index): """ (list of list of str, int) -> str Return the characters from the row of the board with index row_index

Finding maximum difference between consecutive elements of an array

Say I have an array: [44, 30, 24, 32, 35, 30, 40, 38, 15] Here, every number represents a stock value on a certain day. I want to find the maximum profit that

How to merge two lists using LINQ Suming a especific field when the id matched

Considering I have 2 list (firstList and secondList), both with same properties, but with diffent values. I need the result merge both lists, but it must consi

How can I sort a list of strings in ascending order of numeric part

I have a list of paths which have multiple numerical parts within them, here is part of it: 'C:\\Python\\Python310\\Scripts\\mockup_test\\17mm.JPG', 'C:\\Python