Questions tagged [loops]
Loops are a type of control flow structure in programming in which a series of statements may be executed repeatedly until some condition is met.
loops
21
questions
0
votes
0
answers
12
views
Normalizing Dataframe with a json column
Hi i am looking for a efficient way to normalise a data frame that contains a column with json data.
i get json response from a website that is saved as a dataframe.
The structure is shown below
enter ...
0
votes
1
answer
19
views
How should my loop replace values properly?
I am working on a scientific medical paper using the HADS-Score for assessing patients' anxiety and depression.
This score consists of 14 items divided in two subscales (HADS-D, HADS-A) of 7 items ...
0
votes
0
answers
19
views
Accessing the previous rows of the same calculating column in dax
I am creating a new calculated column called Final_Value in my calculated table called INDEX_1.
The condition is I have three columns called Kombi,JJJJ_MM, Value. Each kombi consists one row entry for ...
-1
votes
1
answer
47
views
How to get next user input in python for while loop? [duplicate]
I am currently in school taking a python course in this lab it is asking me to create a loop that outputs the users input into a sentence until user enters quit
Ex: If the input is:
apples 5
shoes 2
...
0
votes
0
answers
68
views
How can it be executed one? [closed]
I have this C# code, but there's a small issue, it repeatedly terminates and runs the "bubbles.scr" process every 0.01 second (I know the 'System.Threading.Thread.Sleep(1000);' is ...
0
votes
1
answer
36
views
Create a new column based on other columns for time series data in pandas
I have the following pandas dataframe with columns May, June, and July.
Month
June
July
Aug
June
a
d
g
July
b
e
h
Aug
c
f
i
I want to create a several new columns with a 1 month forecast, 2 month ...
0
votes
0
answers
17
views
Does the FOCAL language allow breaking out of a FOR loop?
I don't have an interpreter handy to try this out. I'm wondering whether FOCAL allows the use of IF inside a FOR line to break out of the loop.
Would something like the following code run, or is it ...
-1
votes
2
answers
41
views
creating a looped stacked barplot with ggplot in R
I am trying to create a stacked barplot with ggplot in R. I have the following dataframe:
Sample
Date
Organism
Antibiotic
Resistance
1
01/01/2020
E Coli
Amoxicillin
S
1
01/01/2020
E Coli
Gentamicin
...
-8
votes
0
answers
73
views
None in Python. How does it work and what does it symbolize?
So I'm currently learning Python and I came across a problem with a None value. I'am asking myself what does it mean in the context of the short program and is there any way to visualize it?
list = ...
1
vote
2
answers
68
views
How do I get my For Next loop to actually loop
I have a loop, however it only finds the first iteration and doesn't loop onto the next iteration.
I've set up a loop. So far, it opens a worksheet called Names, counts rows containing IMP and EXP and ...
-4
votes
0
answers
28
views
Java Script Nested Loop [closed]
How can I achieve this achieve this using nested Loop in Javascript. I've been trying to get it done, I was stocked
I don't know much about nested loop, just learning. It was an assignment. I would ...
0
votes
1
answer
27
views
loop to select the date closest to another date, for multiple variables [closed]
For each MRN ID, I would like to select the date (in OBSERVATION_DATE), in association with various columns (i.e. hdl, ldl, and vldl) that is closest to the dates listed in multiple other columns (i.e....
0
votes
2
answers
15
views
ggplot2 plot title based on other variable then the one used to iterate the loop
I would like to title each plot with an other variable then the one which is used to iterate the loop
My data
Id
Month
Day_available
Soil_type
Id 1
July
7
loam
Id 1
Aug.
5
loam
Id 1
Sept.
14
loam
...
-1
votes
0
answers
20
views
I'm getting type error in python while calculating factorial using recursive Function [duplicate]
def calc_fact(n):
if (n == 1 or n == 0):
return 1
else:
n * calc_fact(n-1)
print(calc_fact(5))
Was trying to create function to calculate factorial facing type error operand not ...
0
votes
0
answers
33
views
JQuery - How to append to element during each iteration of a loop
This is a question that seems to have been asked a number of times here by different people using a number of different coding languages, but no one seems to have come up with a clear definitive ...