All Questions
389
questions
1
vote
2
answers
43
views
Check if greatest rolling change is less than a specific number in dataframe
I have a dataframe of a time series of stock prices and need to see at any point in time if the change (whether it be pct_change(1), pct_change(2), ... , pct_change(7) is less than 20%).
The logic I ...
0
votes
0
answers
20
views
In python, iteration over specific condition with dataframe row not working
Help me in correcting the logic to attain the expected output.
import pandas as pd
# Sample DataFrame
data = {
'phase': ['aaa', 'bbb', 'ccc', 'ddd', 'eee'],
'phase_input': ['NULL', 'io.flow,...
0
votes
1
answer
41
views
R: Error in loop across several columns in a data frame
I am trying to perform a simple loop, adding new columns to a data frame, by using existing columns. Consider the following data set, for an elderly population in the years 1986 to 1989:
col.names <...
0
votes
0
answers
20
views
Multi graphs in subplots for several dataframe
I have several dataframes that are in one Folder, so an iterative for loop for importing and reading each dataset from the folder is writen, however to plot each dataset using subplots in order to ...
0
votes
1
answer
96
views
Cross-referencing columns in two data frames with different lengths
New to R here, driving myself crazy trying to do something that I feel should be simple - thought I'd consult the hive mind before continuing to bang my head against my own limitations. Details:
Two ...
0
votes
1
answer
39
views
how to pick a column with a value in a given row, remove it and continue to next row doing the same in r
I have a dataframe of correlations between cases and controls. Some of these are perfect correlations based on their demographics, (ie they have the exact same combination of demographic values) and ...
-1
votes
1
answer
36
views
How can i iterate a multiplication between two columns to create a new column?
I have 6 ratings that i have to multiply by their respective weights (it's a nasa tlx) to obtain a weighted rating for each domain, like this:
6 ratings
r_mental, r_physical, r_temporal, r_effort, ...
0
votes
2
answers
586
views
Iterate through chunks of a pandas Dataframe
I have a pandas.DataFrame that looks like the following:
Week
Monday
Tuesday
Wednesday
Thursday
Friday
City A
100
300
x
z
w
City B
200
400
y
q
p
None
None
None
None
None
None
Week
Monday
Tuesday
...
0
votes
1
answer
51
views
Iteration through matrix of sports players + probabilities
The Objective
I want to populate a grid which will hold a probability of one player getting a yellow card in a football ("soccer") match depending on 3 factors
player_rate: the average rate ...
0
votes
1
answer
226
views
How do I edit RTF values in a data frame on Python?
unfortunately I can't get any further with my "project" and I can't find a solution that satisfies me, so I'm turning to you now and hope that I will get a good solution to my problem from ...
0
votes
1
answer
41
views
Doing a vlookup type chain in a python dataframe, which labels the number of iterations complete and publishes results in another dataframe
I'm looking to attempt a vlookup chain in a dataframe and the results be published in a new dataframe.
The actual dataframe as many columns but for this task i'm only interested in 2. The data or ...
0
votes
1
answer
517
views
Iterate over PySpark dataframe and get value based on condition
I am reasonably new to using PySpark and have the following problem.
Suppose we have the following table, in reality it would have several thousand rows:
+-----+------------+----------+-----------+
| ...
0
votes
1
answer
34
views
Scaling up case_when (tidyverse) for large dataframe with n rows
I have a dataframe "factDf" where I would like to fill in values in the column "trial_number" based on two conditions. I as well have a reference dataframe "dimDf", the ...
0
votes
1
answer
45
views
Iteration through 2 columns in dataframe for concatenate another column values [duplicate]
Hours=['24', '23', '22', '21', '20', '19', '18','17', '16', '15', '14', '13', '12', '11','10', '09', '08', '07', '06', '05', '04','03', '02', '01', '00']
result=[]
unique_id = df['id'].unique()...
0
votes
0
answers
31
views
Python combination and iteration two dataframes
DataFrame n.1
COL1
COL2
RESULT (sum/count)
0
0
0
1
1
0
1
1
dataframe 2:
I would like to propose you for advice, I can't create the codes of iteration and combination for the computing operation:...