Questions tagged [for-loop]
A for loop is a control structure used by many programming languages to iterate over a range. It is a way of repeating statements a number of times until the loop ends. Depending on the language this may be over a range of integers, iterators, etc.
for-loop
72,063
questions
0
votes
0
answers
14
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 ...
-3
votes
0
answers
30
views
Funciton only doing the "else", and ignoring the "if" - PYTHON [duplicate]
I am doing a math game, and when the "answer_checker" function is called, it only makes the else part, always giving "Wrong" to the answers.
Firstly, I made a function to make a ...
-1
votes
1
answer
46
views
Get the list of nested folders in directory and filter by name in batch script
I am trying to write a batch function where i need exclude some folders while searching in directory
Main Folder
--ProjA Folder
--A Folder
--A.csproj
--Aa Folder
-Aa.csproj
...
0
votes
0
answers
32
views
Speed up for loop to merge two dataframes in pandas
This is my code:
import time
st = time.time()
# Determine the smaller DataFrame
if len(purp_expanded) <= len(demog_expanded):
smaller_df = purp_expanded
larger_df = demog_expanded
...
0
votes
0
answers
46
views
Labels in Python Tkinter frames not being updated in for loop
I created a dictionary of python tkinter frames and when I try to loop through the frame to call a functions which updates the labels in each frame, only the last frame gets updated and rendered to ...
0
votes
2
answers
60
views
Is the & operator is essential to use as address operator [duplicate]
#include<stdio.h>
int main()
{
int a[5]={5,10,15,20,25};
int *p;
int i;
p=a;
for (i=0;i<=5;i++)
{
printf("the address of the %d is = %d\n",*p,p);
...
0
votes
2
answers
65
views
Bash loop on two sets of files simultaneously
I have two sets of files in the same directory :
1.bam
2.bam
3.bam
and
1.txt
2.txt
3.txt
I need to run a command where 1.bam and 1.txt are interpreted together, and so on..
I tried looping through ...
-3
votes
2
answers
59
views
How to skip first element of each row in csv file without changing csv file
I am using a for loop in python to convert the values from the csv file into integer and float then putting them in a list in the code itself but the problem is with that the csv file doesn't only ...
0
votes
0
answers
40
views
How can I get my for loop to work in R to count occurrences? [closed]
I am running a for loop in R for a data frame "WOS" searching in its columns "Article Title" and "Abstract" for specific terms listed in the data frame "Combined_633&...
0
votes
1
answer
28
views
For loop in react using cards
I'm working on recipe project . I have fetch the all data from an API like image ,video ,ingredients into the react cards.
Now i want to the Ingredients for each card as per need . For example card1 ...
0
votes
0
answers
52
views
VBA Looping with multiple variables
I have a worksheet with multiple tabs. What’s the best method to loop through multiple iterations of variables. I’m showing the code I have for one iteration and would like to repeat that code ...
0
votes
1
answer
26
views
BigQuery: input parameter used for dataset name in for loop
I have a stored procedure that uses a for loop to read through the records in a table and carry out some actions. Is it possible to use an input parameter to specify the dataset and table names?
For ...
1
vote
2
answers
34
views
postgresql - get cumulative count, in for loop?
In postgresql, how to get cumulative count? I wanted to get a cumulative count of customers enrolled between 01-01 and 02-01, 01-01 and 03-01, 01-01 and 04-01 etc.,
Not sure if we can do for loop like ...
0
votes
2
answers
38
views
How do I list certificates in personal store across all servers in domain
I need to get a list of all of the certificates in the personal store across all of the servers in my domain. I am currently using the following powershell command which provides the desired results
...
-4
votes
2
answers
36
views
Repeated result for if statement in python [duplicate]
token_list = ['lg', 'was', 'beaten']
defined_words = ['hand', 'leg', 'head', 'arm', 'finger', 'wrist', 'thigh']
for i in range(0, len(token_list), 1):
if token_list[i] in defined_words:
...