Questions tagged [iteration]
Iterations are the successive repetitions in loops such as for, foreach or while. Questions with this tag are often concerned about how to best handle a collection of data.
iteration
10,908
questions
-5
votes
0
answers
77
views
C++ For Loop is not working correctly and cant find the bug [closed]
i have been working on a c++ program that calculates the arithmetic, geometric and harmonic means.
the first instance of the calculation gives the correct figures for the arithmetic, geometric and ...
0
votes
0
answers
4k
views
Iterations and multi-replacement
I have a file named file.in that contains 6 columns of data. One of the columns contains the mean and another contains the error. File.in is around 900 lines long with a different value for mean and ...
0
votes
0
answers
15
views
How use each in cypress when element is detached from DOM after action [duplicate]
I have this cypress code and it works. I need to iterate through all the links on the page. After clicking on each link, a breadcrumb tab opens. After closing the tab, the page with the links returns.
...
-1
votes
1
answer
51
views
Javascript : Find node value through recursive iteration
I have the following structure :
var content = {
"id": "RkktMTA1OC0wNTE3QElNQi82NTAwNC9YLzAwSDc",
"name": "FI-1058-0517",
"category": &...
0
votes
1
answer
24
views
Iterate through all the days in a month in DJANGO template
enter image description here
I have a model table like above which contains two columns on which dates on which an item is being sold in a month.
I want to show the entire month table in Django ...
0
votes
0
answers
9
views
How to extract particular field from custom duplicate objects and build a another response list using java 8 streams
I have below response from database and I need to convert it into the final json format using java 8 streams.
Response from Database:
[
{
"name": "Test1",
"age": "33&...
-4
votes
1
answer
63
views
Python Apply function to create new rows in loop
Goal: Here is a sample of a dataset that has "ID", "PHASENAME", "CDAYS", "MULTI_FACTOR", "DAY_COUNTER", and "DAILY_LABOR_PERCENT". The goal ...
0
votes
1
answer
40
views
Not able to get iteration in curly codes or php correctly
I have uploaded images as follows:
image 1 (an image is uploaded)
image 2 (no image is uploaded)
image 3 (an image is uploaded)
image 4 (no image is uploaded)
image 5 ...
-2
votes
0
answers
22
views
Object Not Updating Inside FOR Loop [duplicate]
Can someone please explain why this object is not being updated? This has been annoying me for more than an hour. When I run the code on this website: https://playcode.io/1919282, the fillcolor is the ...
0
votes
1
answer
46
views
Azure DevOps Rest API - Creating Iteration don't work
First I call all iterations that I have in my project - and it works fine and then I want to create a new one via the API. , but the method doesn't work, I get the error:
The remote server returned ...
0
votes
1
answer
84
views
My C code is able to iterate once through and come up with the correct mileage but on the second iteration it fails
The problems objective is to write a program that takes a number of data sets the user would like to enter and then within the data sets it counts how many miles you traveled. For example for the ...
0
votes
5
answers
130
views
Variable number of nested array iterations in C
First, sorry if the title is not clear, but I don't know how to ask this properly.
Imagine I have an array of N elements, in this case 4:
#define ELEMENT_COUNT 4
int arr[ELEMENT_COUNT] = { 'a', 'b', '...
0
votes
0
answers
28
views
Execution is very slow for GAN
I wrote a code on GAN and had previously trained in the Colab environment. I leave the Colab code below.
def build_generator(latent_dim):
"""Build the generator model.""&...
2
votes
3
answers
106
views
How to iterate over multiple ranges / sequences / numbers specified in var?
I can iterate over multiple ranges / sequences / numbers with constructions like:
for i in $(seq 1 3) 5 $(seq 7 9) 11; do echo $i; done
for i in {1..3} 5 {7..9} 11; do echo $i; done
But how to ...
1
vote
3
answers
74
views
How to iterate through a dictionary to get values on the lowest level?
Please help me understand how to extract the value of each ingredient for each product and do something with it. But for starters I just want to print them all one by one.
MENU = {
"product_1&...
0
votes
0
answers
28
views
Problem with double-mesh and error estimation
I am writing a Matlab code for a first-order nonlinear singularly perturbed parameterized problem with integral boundary condition. I have successfully achieved the desired order of convergence for ...
-1
votes
3
answers
63
views
Formula to iterate the input range and stack the results into a column
Demonstration of what the result should look like:
I need a formula in Google Sheets that iterates each input from input range, the look-up results for every single input will be stacked into a ...
0
votes
0
answers
62
views
Loop over grouped data in R
I have two dataframes, one where id is a primary identifier and the other is long data. I merged both and so I have long data (this can be reversed). I grouped the data based on id and want to loop ...
0
votes
0
answers
25
views
Efficient method for sharding BigQuery table collection
I would like to ask for advice regarding the following task: assume a collection of BQ tables bearing names with structure name_YYYYMM and containing each a DATETIME type column called date_time whose ...
0
votes
2
answers
38
views
How to validate JSON response using JSON test data file?
Having JSON response with nested elements. I would like to validate it against JSON test data using Postman and test functions.
For the moment I can easily reach it by hardcoding:
const jsonData = pm....
0
votes
2
answers
37
views
how do i create and append to a new dataframe utilizing a iteration loop to extract of data?
i want to have a basic direct method to use different criteria to form new dataframes which i will display in a simple pie chart. i have such a feeble grasp of the topic that it seems to be difficult ...
0
votes
1
answer
35
views
What is the best way to have different entry points for a list of iterative commands?
I have a list of iterative Python commands:
def command_list(start_at):
step1
step2
step3
# ...
stepN
Now I want to start_at different steps in this list of commands and then ...
2
votes
1
answer
71
views
Tidying data frame with multiple variables within multiple columns
I'm working with a "molten" data frame, though perhaps "volcano" is a more apt description of it.
Basically, there are two columns in this data frame that break the first rule of ...
1
vote
2
answers
43
views
Check if greatest rolling change is less than a specific number in dataframe
I have a dataframe of a time series of stock prices and need to see at any point in time if the change (whether it be pct_change(1), pct_change(2), ... , pct_change(7) is less than 20%).
The logic I ...
0
votes
0
answers
18
views
How to load multiple .mat files with different suffix once I selected a starting file?
I have the following problem which I do not know how to approach:
I have a folder with four .mat files like this:
LeCroy000_000_ch1.mat
LeCroy000_000_ch2.mat
LeCroy000_001_ch1.mat
LeCroy000_001_ch2....
1
vote
1
answer
53
views
Netlogo: efficient iteration using 'foreach'
I want to calculate and store two certain quantities associated with turtles' properties, namely count how many turtles meet a condition and the sum of these turtles' specific attribute. That specific ...
0
votes
3
answers
90
views
I have a query to generate sequence of dates based on a given start date. I want to run the same query for all other dates and union the results
I have table1 with startdates in a column
10/02/2023
StartDate
04/02/2023
15/03/2023
I have around 500 values in this table.
I need an extra column which will generates by adding a month to the ...
1
vote
1
answer
96
views
Improving performance of iteration in R
I originally created a for loop to calculate numerous variables that were sometimes dependent on previous iterations e.g. [i] and [i-1].
To improve the performance for larger datasets I attempted to ...
0
votes
0
answers
29
views
Mongodb iterative methods inside aggregate pipeline
Hi so I am working on a database and we have 100k entries where the structure looks similar to
dict = {
'testResults': {
'test_1':1, #1 or 0 if a test passed/failed ...
1
vote
2
answers
63
views
Iterate along the two vectors of different length using map()
I have two vectors of unequal length. One vector is a list of dataframes and the other vector is made up of unique values. How can I use map() to iterate the vectors over a custom function? Dummy data ...