Skip to main content
Filter by
Sorted by
Tagged with
-1 votes
1 answer
63 views

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 ...
Kan's user avatar
  • 41
0 votes
1 answer
147 views

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 ...
s84492025's user avatar
-6 votes
1 answer
116 views

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, ...
Kan's user avatar
  • 41
4 votes
3 answers
175 views

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 ...
Andrew Attfield's user avatar
-2 votes
1 answer
67 views

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 ...
Dave Clark's user avatar
0 votes
4 answers
156 views

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 ...
Patrick's user avatar
  • 2,623
1 vote
1 answer
57 views

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 ...
MAK's user avatar
  • 7,345
-3 votes
1 answer
90 views

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)**...
124567's user avatar
  • 19
0 votes
1 answer
113 views

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 ...
smheidrich's user avatar
  • 4,628
6 votes
2 answers
164 views

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 ...
Norman Gaywood's user avatar
0 votes
0 answers
60 views

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 ...
MAK's user avatar
  • 7,345
3 votes
4 answers
126 views

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 ...
KatChristiansen's user avatar
2 votes
1 answer
87 views

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 ...
Ben's user avatar
  • 539
1 vote
1 answer
103 views

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 ...
JPrest's user avatar
  • 13
2 votes
2 answers
116 views

I have a code that uses a bunch of jax.lax.fori_loop. The documentation of fori_loop says that "setting upper <= lower will produce no iterations". So I was naively expecting the loop to ...
Ben's user avatar
  • 539
-1 votes
1 answer
129 views

I need to choose опе book without a sale. On the page, I have 9 products, and some of them have the class hasDiscount. I need to choose the first product without the class hasDiscount. But: I need to ...
user31616077's user avatar
0 votes
0 answers
37 views

I’m new to n8n and currently learning how to use a For Loop to generate social media posts with a delay between each iteration. I’ve set it up successfully for the LinkedIn node — the loop runs and ...
Developer's user avatar
  • 847
-2 votes
2 answers
122 views

Source Code below. Self-teaching myself this language after taking a c++ course. I find the length of the string, then use the difference between that and the number of loop iterations to assign the ...
Christian Bishop's user avatar
0 votes
0 answers
62 views

I'm trying to solve Project Euler Problem 12 in C++, which is to find the first triangular number with over 500 divisors. I am currently trying to write a function that counts the number of divisors ...
Andy Mc's user avatar
1 vote
1 answer
205 views

I know that a simple R "for" loop like the following: n <- 20 for (i in 1:n) { print(i) } can be represented by a flowchart like: However, in any set of flowchart symbols there is the ...
JulioSergio's user avatar
-4 votes
3 answers
142 views

While practising nested loops in C, I wanted to understand how control flows between an outer loop and an inner loop. I understood that the inner loop runs for each iteration of the outer loop, but ...
xapet's user avatar
  • 49
0 votes
2 answers
147 views

I am using a large dataset which contains patients with 5 different cancer types. Each patient can have one or more cancer diagnosis, identified in the n.cancers column. There are also columns for ...
Evridiki Georgaki's user avatar
-3 votes
1 answer
76 views

The code: #This is the second version of the marks analysis program L = [] #This list will contain both marks and subject S = [] M = []#This list will only contain marks, for calculation purpose def ...
PCuser2009's user avatar
1 vote
2 answers
187 views

I'm currently trying to filter a dataset containing audio data on bird species. The data looks like this: head(audiomoth_sample) id park park_abbr am_no sci_name com_name start_s end_s conf date_time ...
Peregrine9991's user avatar
2 votes
1 answer
73 views

Using Angular V18. Attempting to use the @for loop to render multiple child components, but receiving error "Type 'InputSignal<LoopTile[]>' must have a 'Symbol.iterator' method that returns ...
Vladmere's user avatar
3 votes
1 answer
76 views

I've used ngFor for many years now, but have been interested in transitioning over to the newer @for as it seems to make the code a little cleaner (in my opinion). However recently I just discovered ...
Stanton's user avatar
  • 1,108
4 votes
1 answer
135 views

Saving a ggplots as PNG within a loop gives me a wrong plot title for one of the plots. See reprex below, output corresponds to what I see in RStudio plot pane. But then, my saved PNG via ggsave() has ...
user3460194's user avatar
0 votes
1 answer
58 views

I am trying to read XML into a JSONNode so I can pull values from it. For some reason the .get() function is reading the wrong Node. This is the XML I am trying to read: <order> <order_ID&...
Karson074's user avatar
  • 127
0 votes
1 answer
49 views

I've been programming an inventory system. When I created the function to drag objects from one slot to another, I've been stuck even after some research. At first, objects are dragged, but the ...
Charles Dev's user avatar
-5 votes
1 answer
157 views

I tried so many times to code with my own understanding, but the VBA code did not return correct outputs as I do manually. The objective: Return the 2 below outputs: a beginning date and an end date ...
Dg PHAM's user avatar
  • 11
3 votes
1 answer
90 views

I am trying to re-run a nested for loop within a while loop if the while condition is not met. If the condition is met then I want the inner loop to terminate and proceed to the next iteration of the ...
user3500717's user avatar
-2 votes
1 answer
181 views

While learning about parallelism, I learned that C++ support parallelism through functions such as std::for_each, std::transform and execution policy. So if, for example, we want to divide elements of ...
Le_Square's user avatar
3 votes
4 answers
206 views

I need to get the Cartesian product of a dictionary {str: Fraction} with itself, but currently need to "loop" through the dict twice, once for the keys and once for the values. The ...
Ameya's user avatar
  • 1,770
0 votes
1 answer
90 views

i would like to create a nested list of arbitrary depth (containing numerical values specifically) with uniform arbitrary lengths at each level and then compress it to a NumPy array of minimum ...
L8t Original's user avatar
2 votes
3 answers
110 views

We are working with the following code: int i, j, k; for (i = 2; i < n; i++){ // S1 for (j = 3; j < n - 3; j++){ // S2 for (k = 4; k < n - 4; k++){ // S3 A[...
user31223185's user avatar
0 votes
2 answers
99 views

I have multiple simple DFs with survey results (I've made up test data below that yields the same result). I'm trying to write a loop to select two of the seven columns so I don't have to write the ...
regulationboomerang's user avatar
5 votes
2 answers
269 views

I'm using Python 3.12.11 with Numba 0.61.2 on Ubuntu 22.04.5 and AMD Ryzen 7 3800X CPU. This benchmark: import numpy as np, timeit as ti, numba as nb @nb.njit(fastmath=True) def f1d(img, w): fl = ...
Paul Jurczak's user avatar
  • 8,630
2 votes
1 answer
146 views

I'm a beginner programmer learning C as a hobby. I just learned about accepting user input using scanf() and thought it would be a fun learning experience to make a small "game" that runs in ...
gus's user avatar
  • 23
0 votes
2 answers
159 views

I have a python code that calculates a function F(X), where both F and X are arrays of the same shape. F(X) uses another function called from a package that only accepts a scalar as an argument, but I ...
Dennis Fr's user avatar
-4 votes
1 answer
110 views

I'm learning JavaScript and practicing merging arrays. Here's one of the methods I wrote using two for loops: const arr1 = [4, 5, 7, 9, 8]; const arr2 = [-1, -2, 0, 12]; const arr3 = []; for (let i = ...
user31029120's user avatar
0 votes
1 answer
153 views

I am using Nginx + Lua (OpenResty, LuaJIT), and I did some performance tests on various loops. local ngx_log = ngx.log -- https://openresty-reference.readthedocs.io/en/latest/Lua_Nginx_API/#nginx-log-...
C0nw0nk's user avatar
  • 992
1 vote
0 answers
41 views

I'm currently in Matlab doing a set of fixed point iterations using fmincon. I use parfor multithreading to do so. However, one of my iterations in the parfor loop goes particularly slow just because ...
ZZ Top's user avatar
  • 105
1 vote
2 answers
59 views

I use and like the sjt.xtab crosstab tool from the sjPlot package. Is there a way to create multiple crosstabs in one output file for a defined independent variable and multiple dependent variables? ...
Maciej B.'s user avatar
  • 393
2 votes
1 answer
75 views

I have two datasets/dataframes df1 and df2, I want to generate df3 by finding the difference between numeric columns of df2 and df1's column_X. #### copy and paste below to generate df1 and df2 ...
nasa313's user avatar
  • 322
0 votes
0 answers
31 views

I'm using QGIS 3.40.8 and need to automate kernel density calculations across a nested folder structure. I don't know Python - the code below was created by an LLM based on my QGIS log output from ...
Nikos's user avatar
  • 413
6 votes
1 answer
347 views

I'm experimenting with the new C++ compile-time reflection features (as described in P2996R0) and I testing a simple enum_to_string() utility using template for: template <typename E> requires ...
Artem Selivanov's user avatar
0 votes
1 answer
94 views

I have been trying to figure out how to use VBScript to process files in a folder based on their names, create a couple of subfolders, and place the different files into the corresponding subfolders ...
Simon Barrett's user avatar
1 vote
2 answers
84 views

HTML <dialog class="dialog"> <button class="close" autofocus>×</button> <p>Some Content</p> </dialog> <button class="button open"&...
DumbDumbStack's user avatar
0 votes
1 answer
124 views

The user has ten chances to guess a four-digit number. After each guess, the computer should print out the message that is included in the code below. I would like the code to list the numbers that ...
Agnieszka's user avatar
0 votes
0 answers
35 views

I’m trying to understand the difference in behavior between let and var inside a for loop, especially when used with setTimeout. Here’s a simple example: for (var i = 0; i < 3; i++) { setTimeout((...
Ritam Laha's user avatar

1
2 3 4 5
1442