Skip to main content

All Questions

0 votes
1 answer
526 views

Image color-moment extractor [closed]

I was just wondering if there is a way to speed up the performances of this for loops in Python. I'm trying to process an image to get the color-moments without using libraries. It takes about 12sec ...
Enrico Mosca's user avatar
2 votes
0 answers
116 views

Extract cell values from multiband rasters

I have the following function and code snippet to extract cell values for multiple years, format it, and save to a list. Each raster has 365 bands — one for each day. A separate operation is performed ...
Ibe's user avatar
  • 121
5 votes
1 answer
1k views

Improving the speed of creation for three Perlin Noise Maps in Python?

I am interested in learning how I can improve the speed of the code in this pygame file. I iterate over 6400 * 1800 * 3 or 34,560,000 elements of various numpy arrays here to apply noise values to ...
LuminousNutria's user avatar
7 votes
1 answer
1k views

Plotting terrain pixels with PyGame based on random NumPy array

I am experimenting with Perlin Noise and random map generation. I have a 2D numpy ndarray full of 16-bit floats called map_list that I call from the singleton ...
LuminousNutria's user avatar
3 votes
2 answers
4k views

Calculate True Positive, False Positive, True Negative and False negative and colourize output

Objective : Calculate True Positive, False Positive, True Negative and False negative and colourize the image accordignly, based on ground-truth and prediction from my classifier model. Problem : ...
user avatar
4 votes
1 answer
334 views

Surface Density Profile

I am trying to compute the surface density profile, given the spherical density profile in 3D for different parameters in order to interpolate and have it as a function of them to use later on for ...
Sketos's user avatar
  • 53
9 votes
1 answer
4k views

Optimizing a python script with large arrays

I have a python script that I'd like to speed up. I'm hoping some of the gurus here can offer some advice. The script reads in some data from file: 2 arrays with lat/lon vals, 3 arrays with image ...
os1's user avatar
  • 201
2 votes
1 answer
776 views

Benchmark using floating point math

I wrote some code in Python, to benchmark mathematical operations. It does not do anything in particular besides just calculating a lot of floating point numbers. To clarify: I need 128-bits ...
Iwko's user avatar
  • 43
1 vote
2 answers
273 views

Sieve of Erathosthenes speedup

While reading HackerNews, I learned about a data set of the first 50 million primes. This would be a lot, but his website has disclaimer: n this directory I have the first fifty million primes in ...
john mangual's user avatar
3 votes
2 answers
724 views

Reduction function in Rainbow tables implementation

I'm working on an implementation of Rainbow tables as part of a project. I understand the main principles behind it had have a working solution. Unfortunately the reduction function portion of my ...
Scott's user avatar
  • 131
3 votes
1 answer
7k views

Fast loop to create an array of values [closed]

I have a code that creates a 3D array of values from a minimum to a maximum in X and Z with constant Y. Right now I make it in normal Python, and then I transform it in a ...
adrienlucca.net's user avatar
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