Skip to main content

All Questions

Tagged with
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 ...
adrienlucca.net's user avatar
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 ...
kame's user avatar
  • 183
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 ...
embert's user avatar
  • 445
1 vote
1 answer
10k views

Fastest way for working with itertools.combinations

I need to speed up the function below: ...
querzy's user avatar
  • 13
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 ...
user2913161's user avatar
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 ...
ThiS's user avatar
  • 66
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 ...
fishiwhj's user avatar
  • 341
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 ...
dassouki's user avatar
  • 1,111
4 votes
1 answer
490 views

Eliminate for loops in numpy implementation

I have the following dataset in numpy ...
siamii's user avatar
  • 163
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 ...
mac389's user avatar
  • 171
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 ...
root-11's user avatar
  • 512
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 ...
Newmu's user avatar
  • 143
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 ...
strimp099's user avatar
  • 183
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). ...
Peter Smit's user avatar

15 30 50 per page
1
12 13 14 15
16