All Questions
Tagged with performance numpy
239
questions
1
vote
1
answer
859
views
Vectorize pairwise edit distance computation [closed]
How can I vectorize this function? It takes an array of array of tuples as input and computes the distance between elements using Levenshtein's method. I found some simpler examples but they weren't ...
1
vote
1
answer
44
views
Optimization fo code snippet including multiple np.multipy statements
I working on optimizing some code for speed in a python module. I have pinned down the bottleneck and is a code snippet which calculates three np.ndarrays. Namely ...
4
votes
1
answer
171
views
improving speed of this numpy-based diffraction calculator
I'm going to simulate diffraction patterns of a normal incident gaussian profile beam from a 2D array of point scatterers with a distribution in heights.
The 2D array of scatterer positions ...
2
votes
0
answers
59
views
Generate Black and White confidence map masks for joints, same as OpenPose/Convolutional Pose Machines
Attached below is my code for generating the confidence maps for the joint locations, it is in the same vein as the maps generated for the paper Convolutional Pose Machines and OpenPose. I am ...
1
vote
1
answer
94
views
Optimize option pricing code
I am new to Python and am trying to optimize the following code:
...
9
votes
3
answers
1k
views
Creating an affinity-matrix between protein and RNA sequences
I wrote an algorithm that analyzes protein-RNA interactions and I found that the following function is the bottleneck that causes performance issues:
...
4
votes
1
answer
142
views
Save points cloud in PLOT3D format
I have the following function to save points cloud in PLOT3D format:
...
5
votes
1
answer
2k
views
Remove words from an exclude list in each row of a pandas.Series
I am trying to remove all occurrences of the words I collect in the list exclude from every text note. This is my approach.
...
8
votes
1
answer
530
views
Optimize Performance of Region Checking in List Comprehension
I am modeling a linear process at a number of equally spaced time steps. I have a large list (~70k elements) which corresponds to a location at each time step, ...
5
votes
1
answer
5k
views
Minimax algorithm for tic tac toe in Python
I am using minimax algorithm (for now without alpha beta pruning) for AI in tic tac toe game in Python and Numpy. It's working, but very slow, so I would like to optimize it.
A few rules for current ...
5
votes
1
answer
400
views
State space search for sliding tile puzzle
I am working on state space search (8 Puzzle) in Python and when I run my program with python3 -m profile, I find out that most of time program performs a few ...
3
votes
1
answer
352
views
Particle simulator using Python - Why is the NumPy version slower than pure Python?
This is an interesting example from G.Lanaro's book, Python High Performance. The program is a simple simulator which describes movement of particles based on their positions and angular velocities (<...
8
votes
2
answers
1k
views
Schelling's model of Segregation Python implementation with Geopandas (Follow-up)
This is the repost of the following question as suggested by @HoboProber .
Again, if you don't know what is Schelling's model of segregation, you can read it here.
The Schelling model of ...
1
vote
2
answers
151
views
Is it worth to compromise on speed to follow PEP 8 guidelines? [closed]
I have this long line of code:
enc = encoder.predict(np.array([data[stock][4*i:4*(i+30)] for i in range(lens[stock]+days-30)]))
The problem is, the number of ...
4
votes
1
answer
546
views
Cython functions for generating NumPy date ranges
I have rewritten my python code in cython in order to speed up it quite a bit. However after checking the code in jupyter it seems that part of it is still compiled as python code, therefore its not ...