Category "loops"

Loop through filtered criteria only once

The goal of this script is to loop through each criteria filtered in Column C, starting from C8 where my header is located. The information below will be a list

Looping through all files in a directory [duplicate]

I want to write a shell script that will loop through all the files in a directory and echo "put ${filename}". Can anyone point me in the righ

trying to convert C to Lisp

I am trying to convert this code to lisp code. But don't know how to do it is it right? for (j=i-1; j>=0 && list[j]>key; j--) { list[j+1] = li

insert variable into url during for loop

I'm trying to do a scrape via a for loop. I just need to insert the date ranges in "seasons" each time through into the curly brackets in "url." I provided "bas

How to loop and display array of objects and their nested arrays

I need help, I got stuck on objects with multiple nested arrays. I have a json file which consists of object, that holds array of objects, and these objects hav

program to find the sum of the first N odd numbers

I'm trying to make a program that calculates the sum of the first N odd numbers. where N is the number of the first odd numbers (e.g. N=4, then the first odds a

Loop for load multiples files (C++)

I´m trying to load all the files in a folder that have names from the form "file_i.csv". For this I write the program: void load_reel_set() { bool fil

Python exit() command trigger infinite loop

Greeting all, I encountered infinite loop when running the code below when input option = 3. def enter_number_only(): print() print("===================

How do you remove duplicate values in array in Python?

I have an array where each element is the mean of a set of random numbers. I want to be able to remove duplicate values in this array. How would I go about doin

T-SQL hierarchy query

I have a table with hierarchical data: This is a sample of data with id, parent id, name, code (which is sometimes not filled), level and isroot column. In r

How to stop Python while I key in a value that indicates "break"

in the python code below, the desired output is to find the max and min from all of the key-in values (via input function) and when I key in "done", it stops (m

How do I use a for loop to manage increments of an object property in JavaScript?

I’m doing a rockPaperScissors project. Here’s the published link: https://george-swift.github.io/rockPaperScissors/. I want to add a first to 5 feat

Does the .includes method in JavaScript loop through the array and case O(n)?

Does the .includes method cause O(n^2) when run with another loop such as in this simple example? function myFn(){ let age = people.map(person => {

Python print non-prime numbers

I have a hackkerank coding challenge to print first n non prime numbers, i have the working code but the problem is that they have a locked code which prints nu

creating dictionary with ansible

I want to create a dictionary in ansible from a list; using some variables for the value in the key-value pair of the dictionary, but it seems to be not working

Looping through patches that share a common properties in Netlogo

I would like to sum up one numeric properties (AT1) of patches that share the same ID and store the value for that ID (procedure simulation here-below). I start

Object declaration in a loop for different ML models

Can anyone help me out, how can I perform the following task? I am getting an error TypeError: 'str' object is not callable models = ['LogisticRegression','Rand

Can numpy.tensordot or ufunc replace this nested for loop?

Note: I know this is very similar to Use numpy.tensordot to replace a nested loop , only that the actual instance we are working on seemed different( I need qua

How to Paste string of values in single cell of Excel using VBA

I have 2 sheets named "Target Data" and "Pivot". I have filtered data in "Target Data" and now want to copy only visible cells in single cell of "Pivot" sheet.

How to find a value of a key in a nested dictionary with lists?

There's some very strange json payloads that I need to parse and I'm complete stuck.. Say I have a nested dictionary with lists that looks like this: test_dict1