72,075 questions
-1 votes
1 answer
55 views
Using list to find variables from data in rows
I am trying to find a combination where it will go through the data to find matched variables for any value from the list First_row is found, any value from the list Second_row and any value from the ...
0 votes
1 answer
139 views
Construct a simple loop to create new data frames in R [closed]
I have a number of data.frames, with names apple, banana, and coffee. I want to create, and then export, new dataframes in a for-loop corresponding to each one, call them apple_new, banana_new, and ...
-6 votes
0 answers
75 views
Cmd: Nonsense in "For /F"-Loop on (Win11 [closed]
This is the beginning of my project. And I ran into many problems faster than expected — problems that no AI could help me with, I know of the moment. Just ignore the fact that it was written for ...
-6 votes
1 answer
116 views
Using for loop to find a common value for every time another common value appears
import pandas as pd a=1 b=2 c=3 for n in range(10, len(df)-1): if df.loc[n].isin([a]).any() and df.loc[n].isin([b]).any() : for x in range(0, ...
4 votes
3 answers
175 views
Why does my C code display the correct output, but with garbage characters added after?
The practice question I am working on reads as: Read two strings, both of them do not contain white spaces (but may contain non-alphanumeric, such as ‘,’, ‘.’, ‘/’ ...). Display the first string ...
-2 votes
1 answer
67 views
DO Error during String Replacement using Windows Batch Script
I obtained a batch script from Google AI for performing string replacement on the content of a list of text files in Windows. This is what I got--with a little tweaking, first. (Just testing at this ...
0 votes
4 answers
156 views
How to encapsulate a for clause?
This is more like an exercise. I have several conditions that affect 2 nested for clauses: for(...)//1st { for(...)//2nd { ... } } and since there are various possibilities (each one ...
1 vote
1 answer
57 views
Redshift : Opening multiple cursors from within the same client connection is not allowed
I have the following procedure written in redshift, which uses 2 for loops to get country code first and then years as per the country codes. --Procedure : sp_for_loop_test create or replace procedure ...
-3 votes
1 answer
90 views
trying to create a getPrincipal function [closed]
trying to create a function to get the principal amount for a loan using the for loop for the sum of present values def presentValue(amount, num_months, interest): return (amount)/(1 + interest)**...
0 votes
1 answer
113 views
for loop over value in ForM.forM definition for that value's own type
Background As the Lean Reference's Instances for nested types example shows, in a function that implements a type class method for a certain type, one can already use the type class instance for that ...
6 votes
2 answers
164 views
How to use the raku operator 'ff'or 'fff' in a 'for lines()' loop
Given the input file: ---------------- A ---------------- information for A on these lines ---------------- B ---------------- Something about B on these lines etc I want to produce: A: information ...
0 votes
0 answers
58 views
Redshift - SQL Error: Internal jdbc driver error
I am trying to use for loop within the stored procedure to retrieve the employee id and process further but getting an error: Error: SQL Error: Internal jdbc driver error Procedure: create or replace ...
3 votes
4 answers
126 views
Creating a group by loop using either single or multiple variables from a list in R
I am trying to perform a loop which loops through a list of single or multiple variables then sums a column. I am essentially trying to paste in from a list into the group_by() function so that it ...
2 votes
1 answer
86 views
Wrap `jax.lax.fori_loop` to systematically override `upper<=lower` tracing behavior
This is a follow-up to a previous question about the jax.lax.fori_loop function, with a little bit of a challenge for you at the end. As described in the documentation, the fori_loop is never executed ...
1 vote
1 answer
103 views
Windows batch file cuts off file extension in for statement
I noticed that some software I use, AutoDarkMode, doesn't randomize the first wallpaper it switches to, so I thought I'd write a batch file to do it by copying one wallpaper in the folder and renaming ...