All Questions
Tagged with performance numpy
239
questions
14
votes
1
answer
10k
views
Faster computation of barycentric coordinates for many points
I'm just starting to understand the Python syntax and I created a module that does what I wanted, but really slow.
Here are the stats of cProfile, top 10 ordered by ...
3
votes
2
answers
611
views
How can I make my ant simulation faster?
I was not sure if I should post about 200 lines here. I want to make this ant simulation faster. The bottleneck is at Ant.checkdistancebetweenantsandfood().
It ...
18
votes
2
answers
97k
views
Fastest way to iterate over Numpy array
I wrote a function to calculate the gamma coefficient of a clustering. The bottleneck is the comparison of values from dist_withing to ...
1
vote
1
answer
10k
views
Fastest way for working with itertools.combinations
I need to speed up the function below:
...
2
votes
1
answer
170
views
How to reduce runtime of gene data processing program?
This program takes a huge data set as input, processes it, calculates and then writes the output to an array. Most calculations may be quite simple, such as summation. In the input file, there are ...
1
vote
3
answers
1k
views
NumPy Scipy optimization
I have an optimization issue and I'm not sure if I can improve the overall speed of my function.
The function draw_w is my actual implementation that gives me the ...
4
votes
1
answer
1k
views
Statistical samples and distributions
It is usually inefficient to find bugs in a longer code. Unfortunately, after spending too much time in debugging my code, I realize that a good programming habit is important. Please give me some ...
52
votes
3
answers
170k
views
Finding the closest point to a list of points
I'm trying to find the closest point (Euclidean distance) from a user-inputted point to a list of 50,000 points that I have. Note that the list of points changes all the time. and the closest distance ...
4
votes
1
answer
490
views
Eliminate for loops in numpy implementation
I have the following dataset in numpy
...
3
votes
2
answers
566
views
Specialized version of the cross correlation function
I am writing a specialized version of the cross correlation function as used in neuroscience. The function below is supposed to take a time series data and ask how ...
3
votes
1
answer
3k
views
Are these list-comprehensions written the fastest possible way?
This is a simple repeatable question regarding the usage of Python3's comprehensions:
Could the Python3 syntax be used in another way to speed up the process, further so the gap between Python3 and ...
4
votes
1
answer
1k
views
Mean shift image processing algorithm for color segmentation
I'm implementing a version of the mean shift image processing algorithm for color segmentation in Python/NumPy.
I've written a pure NumPy version of the actual mean shifting per pixel (which I ...
6
votes
5
answers
11k
views
Calculating the maximum drawdown of a set of returns
I wrote a simple function that calculates and returns the maximum drawdown of a set of returns. I am trying to squeeze as much efficiency for speed out of the code as possible. I've got it down to ...
5
votes
1
answer
1k
views
Reading a binary file containing periodic samples
I have the following code for reading HTK feature files. The code below is working completely correct (verified it with unit tests and the output of the original HTK toolkit).
...