All Questions
84 questions
4
votes
1
answer
195
views
Finding specific promotions from two columns [closed]
I'm trying to build a function that identifies those who are promoted into a list of jobcodes, or are promoted within that list of jobcodes.
Initially I was using ...
1
vote
1
answer
83
views
Replace iterrow loops in pandas matrices with something else to shorten the running time
This post is modified from this one: https://codereview.stackexchange.com/posts/292885/edit (Alternatives to iterrow loops in python pandas dataframes).
I have a piece of code to calculate price ...
7
votes
2
answers
693
views
Alternatives to iterrow loops in python pandas dataframes
I have a piece of code to calculate price sensitivity based on the product and its rating.
Below is the original data set with product type, reported year, customer’s rating, price per unit, and ...
2
votes
1
answer
46
views
Maintain a log containing values if certain conditions are met
I'm trying to capture profits and set a stop loss in my trading strategy. I want the stop loss to be set daily based on the past data and if the current price, i.e., price for the date falls below the ...
0
votes
2
answers
133
views
Optimize a Python code which indicates duplicated values in an excel file [closed]
I wrote this code to indicate duplicated values. It actually works but I hope to know if there's another possible solution to optimize this process. Thanks.
...
2
votes
1
answer
185
views
Is this the right implementation for Linear Programming (puLP) on python?
I have created a LP function to help maximize a set of features. My first time playing with this library and also conducting LP.
Variables:
Number of features => X
Number of Categories => Y
...
1
vote
0
answers
57
views
Recurrent Neural Network loss is NAN
I am training a neural network to use approximately 600 features (4103rd to last column of a df) to predict approximately 4000 values (7th to 4102nd column of the same df). I have standardized the ...
1
vote
0
answers
51
views
BoundingBox dataclass implementation with cupy, cudf, and nvector
The dataset I'm working with is rather large so I've been experimenting with cudf and cupy. Here you can find instructions for ...
3
votes
2
answers
202
views
Intercolumn statistics between columns in a dataframe
I have a df and need to count how many adjacent columns have the same sign as other columns based on the sign of the first column, and multiply by the sign of the ...
2
votes
0
answers
235
views
Do Mann-Kendall and Pettitt tests on each CSV file
Here is a function that will take each text file in a directory, do the Mann-Kendall and Pettitt tests, and then write the output to a text file. Would you please suggest me improve the code to make ...
1
vote
1
answer
79
views
Generate new column based on two columns of dataframe
I need to generate column a_b based on column a and column b of ...
1
vote
1
answer
79
views
Stacking Z axis on multiple [1440x720] DataFrames (X, Y)
Each datum represents a point in a 1440x720 image of the globe, The values are 0-9. Each new layer is of a higher elevation. I need to structure a DataFrame in a ...
2
votes
1
answer
192
views
type hinting/documenting/extension of a Cython lib
I've updated some of the type hinting/documentation in a lib called pygrib. The source documentation
can be found here.
The goal is to extend the ...
2
votes
1
answer
78
views
dataframe mean outliers to NaN to derive a higher quality mean for area,speed,azimuth
I have some data that represents the area, speed(meters per second), and azimuth(rads) of a polygon. The objective is to determine the mean for each set of parameters. With that mean value, apply a ...
3
votes
1
answer
231
views
pandas dataframe of temps and numpy.linalg.lstsq
The problem is this. Forecast model data indicates at 0700Z the 1000 milibar temps will be -4C°. The forecaster knows that is incorrect, so they choose to make a correction. This correction should ...