Skip to main content
Filter by
Sorted by
Tagged with
1 vote
0 answers
50 views

I am trying to code a jacobi algorithm w/o using matrices on python. The code I came up with looks fine but it stops at 3rd iteration even though the error is still pretty much large. ps. I am not an ...
Amoin Marl Mikko's user avatar
2 votes
1 answer
121 views

I have a dataframes pulled from a file. The variable with all these dataframe names is: Data_Tables. These dataframes all have the same columns, and I want to concatenate the dataframes based on the ...
Jon S's user avatar
  • 55
Best practices
1 vote
7 replies
117 views

Our program reads results of an SQL query and turns each row into a task for a worker to perform. Something like: for row in query.results(): cluster.submit(row) However, most of the tasks are so ...
Mikhail T.'s user avatar
  • 4,266
-6 votes
2 answers
123 views

I know that modifying a list while iterating over it is dangerous. For example, using my_list.remove() is a famous problem because it causes the iterator to skip the next element. However, I found a ...
Time Mahattano's user avatar
3 votes
4 answers
212 views

Consider an example where one needs to iterate over a sequence with all but the output yes/no requires unwrapping somehow. pub fn interesting(i : u32) -> Result<bool, ()> { if i < 42 { ...
A. K.'s user avatar
  • 39.3k
3 votes
2 answers
276 views

According to the Python documentation, set is a mutable unordered collection. Usually, it's implemented as a hash table that stores references to objects as its keys. Comparing to dict (which is also ...
SLebedev777's user avatar
-5 votes
1 answer
143 views

I made the next class obj = MyClass() fds=['a','b','c'] for i in fds: attribute_name = f"{i}" setattr(obj, attribute_name, [f"{i}"]) print(obj.i) I know that obj.i is ...
Javier Olivares's user avatar
1 vote
1 answer
116 views

My Kotlin project needs to parse files and keep track of the outcome: fun parseFiles(dp:MyDataProvider, files:List<String>) { //store the status of each processed file val statusMap = ...
pbuchheit's user avatar
  • 1,839
0 votes
2 answers
93 views

This will output all csv files from the directory, but only show one of the csv dataframes. OUTPUT_PATH = "./static/output/" FILE_LIST = glob.glob("./static/*.json") def all_data():...
shrykullgod's user avatar
1 vote
1 answer
61 views

Issue For my workflow I need to repeat a certain number of rules multiple times, the idea is that with each of these iteration the output gets better and better. I had issue with adding new jobs to ...
Tylio's user avatar
  • 23
3 votes
1 answer
159 views

I have a csv file on the webserver (eg. 5GDPR6LR-1.csv) The csv file consists of data from an associative array written to file using fputcsv() within a foreach() loop. The problem occurs when I try ...
Stackman's user avatar
  • 501
1 vote
1 answer
109 views

I'm trying to implement an algorithm for insertion into BST (binary search tree) in Rust. I did it recursively, but am having problems implementing the iterative solution. I'm struggling to borrow a ...
Robert Kusznier's user avatar
1 vote
1 answer
89 views

I have two dataframes, df1: | attribute1 | attribute2 | | -------- | -------- | | value1 | value2 | | value1 | value4 | This is a dataframe with around 20 million ...
Mario117's user avatar
  • 113
2 votes
1 answer
212 views

I'm working on implementing a fuzzy-matching function in VBA for a project I'm working on. Ideally, I'd like it to be iterable, since that way I don't have to deal with the headache of holding its ...
In Hoc Signo's user avatar
0 votes
1 answer
48 views

Sharing a common DolphinDB use case and solution for data processing. I have a table of stock observation data recording minute-by-minute indicator states, with two key indicators: ov95: ...
saki's user avatar
  • 319
0 votes
2 answers
72 views

I am attempting to split a string by each word and symbol into a list. This should put them in separate strings by iteration in the function SplitString(). For example: display("Hello, World!&...
Krylicc's user avatar
3 votes
5 answers
198 views

Is there a way to abuse assignment expressions or functional tools to generate the sequence x, f(x), f(f(x)), ... in one line? Here are some contrived examples to demonstrate: def iter(x, f, lim=10): ...
qwr's user avatar
  • 11.6k
-1 votes
1 answer
126 views

I'm working in Python and I'm trying to generate coordinates for circles with their radii being appended after coordinate generation. Once I have the list I want to check it against itself to see if ...
Inquisitor's user avatar
1 vote
1 answer
49 views

I am attempting to decrease the values of the value column by 0.000001 for observations that are not in the first row into a new column called lagged.values. I then want to fill the NAs resulting from ...
Shaq's user avatar
  • 65
1 vote
4 answers
97 views

I have an audit table (with tablename, date and rec counts) with data as far back as 5 yrs as shown below. My requirement is to retrieve the record counts for the tablename for a specific day and it's ...
marie20's user avatar
  • 895
-1 votes
1 answer
49 views

I'm working through an example and cannot see the solution. Can someone please point me in right direction? Tried lots of stuff. File "C:\Python prog\orbit.py", line 57, in main for ...
Steven Chambers's user avatar
2 votes
1 answer
141 views

Lets assume the code doesn't need the index, but something interesting happened during debugging and I want to know the position of the item in the container. for (int item : myarray) doSomething(...
jozxyqk's user avatar
  • 17.7k
-3 votes
1 answer
53 views

I am performing an iterative optimization using the main function in CPLEX OPL. After each iteration, I want to write the values of the decision variables to an Excel sheet. The optimization runs for ...
SUBHADARSHINI PANDA's user avatar
2 votes
0 answers
101 views

Working on an assignment for my coding class which involves the function below, which is supposed to read quiz scores from an input file and put up to 12 of them into an array. I've narrowed down the ...
M1sf1re's user avatar
  • 21
1 vote
2 answers
133 views

The following is a simplified version of what I am trying to do (the actual implementation has a number of nuances): from __future__ import annotations from collections.abc import MutableMapping ...
fishfin's user avatar
  • 313
0 votes
0 answers
51 views

It is need to solve the problem using the Jacobi method: d^T/dx^2 + d^2T/dy^2 = 0 with conditions at the boundaries of the square: T(0, y) = 1, T(x, 1) = 1, dT/dx(1, y) = 1 - y, dT/dy(x, 0) = x. ...
ulyannaaa's user avatar
0 votes
1 answer
53 views

I want to update a matrix with values of the current iteration as well as the previous iteration in the main function. Please help me in achieving this. I have tried this code. int TSlots = 96; ...
SUBHADARSHINI PANDA's user avatar
2 votes
1 answer
63 views

I am solving an iterative optimization problem in cplex opl using the main function. However, I am getting errors while printing a matrix value. Please help me in solving this issue. int Nod=41; ...
SUBHADARSHINI PANDA's user avatar
-4 votes
2 answers
144 views

Please help in providing a solution to iterate through a JSON response containing lists of dictionaries in python: { "cart": [ { "id": "0Zy2jwLzQzlk7xq3", ...
Bonzo's user avatar
  • 19
3 votes
4 answers
222 views

For the sake of anyone who stumbles upon this in the future, I apologize – I had conceived of the problem and solution incorrectly. A proper implementation of finding the coordinates of pairwise best ...
derived bee's user avatar
1 vote
1 answer
45 views

I am trying to solve an iterative optimization problem in cplex opl using main function. The optimization objective and constraints are written in subvaluenew.mod. float maxOfx = ...; dvar float x; ...
SUBHADARSHINI PANDA's user avatar
0 votes
1 answer
56 views

I am running a CPLEX OPL model for 10 entities. The objective is to optimize a certain objective for each entity. Step 1: The CPLEX model first runs for the first entity, optimizing the objective ...
SUBHADARSHINI PANDA's user avatar
-1 votes
1 answer
54 views

I'va got a folder with an extract of PowerPoint slides, named Folie1.png, Folie2.png ... Within a batch script I'd like to crop and rename them into known names. These names are given in an "...
Michael Free's user avatar
2 votes
2 answers
100 views

I have a list of many combinations of model variables that I'm testing for model fit. I need to figure out how to write an R code that iterates through each one in the model fit. This is what I have ...
Hailey's user avatar
  • 31
2 votes
2 answers
92 views

I am looking for a way, without having to install a new library, to iterate through a Kotlin data class and to change the values according to their type. The implementation I would like is the ...
AvyWam's user avatar
  • 1,012
0 votes
4 answers
172 views

Say I've got a Vec that looks something like [[1,2,3],[4,5,6],[7,8,9]]. How would I iterate over all the inner vecs at once? That is, for k in some_func([[1,2,3],[4,5,6],[7,8,9]]) { println!("...
Vessel's user avatar
  • 155
1 vote
2 answers
94 views

Here is a sample of my df: library(dplyr) # Create the dataframe df <- data.frame( id = c('A', 'A', 'A', 'B', 'C', 'C', 'C', 'C', 'D', 'D', 'D'), supply_start_date = as.Date(c('2024-01-01', '...
user3641630's user avatar
0 votes
2 answers
70 views

I need to call an API interatively, but the api endpoint limits me to 100 calls per minute. I have a list which is used as the data for an API call (I'm using requests to call the API). Lets say the ...
Alan Mott's user avatar
0 votes
1 answer
129 views

Using the Azure DevOps REST API, I am trying to get a list of all the workItems associated with each Iteration, but am mostly getting an empty return. I start with the following call to get the list ...
Warren Levy's user avatar
-1 votes
1 answer
76 views

i have these cols "Price", "functions", & "cat" as df. Price functions cat 51272.85 8 3-8 51134.15 3 3-8 51150 8 3-8 51161.3 1 1-6 51165.45 1 ...
rakesh's user avatar
  • 97
0 votes
1 answer
94 views

I am writing some code in python to find out the first natural number which does not appear in the first billion digits of pi. Here's what I've written: import datetime from tqdm import tqdm def ...
PanC's user avatar
  • 11
0 votes
4 answers
107 views

Given a json file with nested objects (not arrays) like: { "data": { "UniqueName1": { "name": "Bob", "title": &...
user645379's user avatar
1 vote
1 answer
91 views

A B C D E Key 1 1 -1 Key 2 1 -1 Key 3 1 -1 Key 4 -1 1 Key 5 1 -1 Key 6 1 -1 Key 7 1 -1 Key 8 1 -2 1 Final Result A B C D E 1 -1 suppose we have the above dataframe where each key is an option ...
ChairmanMeow's user avatar
0 votes
1 answer
82 views

Relevant Code: for watermelon in self.watermelons.iter_mut() { if watermelon.clr == Color::RED { self.score += 1; self.watermelons.remove(*self.watermelons.index(watermelon)); }...
Andy Galvez's user avatar
1 vote
0 answers
105 views

I'm constructing a graph with ~10000 nodes, each node having metadata that determine which other nodes it will be connected to, using an edge. Since the number of edge possibilities (~50M) is far ...
me9hanics's user avatar
  • 395
1 vote
1 answer
84 views

I have a recursive function in the following form: def f(): if cond1: ... f() elif cond2: ... I've "mechanically" converted it to an iterative function like ...
user200783's user avatar
  • 14.5k
0 votes
2 answers
90 views

I am trying to get a list of scores from user input. I want each prompt to include the current game number, which will increment from 1 to the total number of games. For example, if the user wants to ...
Adnan Ali's user avatar
0 votes
1 answer
86 views

I've been working on porting a library from C to CUDA. Two functions that I need to port make use of recursion, which CUDA doesn't seem to be playing nicely with. I therefore want to convert these ...
ScriptLine Studios's user avatar
0 votes
0 answers
53 views

I am developing a relatively large model using xarray and therefore want to make use of chunks. Most of my operations run a lot faster when chunked but there is one that keeps running (a lot) slower ...
Rogier Westerhoff's user avatar
1 vote
0 answers
27 views

I have a dataset similar to this: library(tibble) df <- data.frame( basket = c("A1", "A2", "A3", "A4", "A5", "A6", "A7", &...
Andrew Skelton's user avatar

1
2 3 4 5
219