I have a function foo(i) that takes an integer and takes a significant amount of time to execute. Will there be a significant performance difference between any of the following ... |
The question is, basically: what would be more preferable, both performance-wise and design-wise - to have a list of objects of a Python class or to have several lists of numerical ... |
I am just getting to know numpy, and I am impressed by its claims of C-like efficiency with memory access in its ndarrays. I wanted to see the differences between these ... |
I'd like to sum one particular row of a large NumPy array. I know the function array.max() will give the maximum across the whole array, and array.max(1) will give me the ... |
I have a problem with the speed of my program. I want to calculate the average of four neighbors in a huge array. Here is a part of my code. Do ... |
See important clarification at bottom of this question.
I am using numpy to speed up some processing of longitude/latitude coordinates. Unfortunately, my numpy "optimizations" made my code run about 5x more slowly ... |
I have an array of values, t, that is always in increasing order (but not always uniformly spaced). I have another single value, x. I need to find the ... |
|
I am baffled by this
def main():
for i in xrange(2560000):
a = [0.0, 0.0, 0.0]
main()
$ time python test.py
real ...
|
I'm still confused whether to use list or numpy array.
I started with the latter, but since I have to do a lot of append
I ended up with many vstacks slowing ... |
I've read " Is shared readonly data copied to different processes for Python multiprocessing ? " but the array described there is global. Is it possible to do the same ... |
I'm interested in the performance of NumPy, when it comes to algorithms that check whether a condition is True for an element and its affiliations (e.g. neighbouring elements) and assign a ... |
I have a very large NumPy array
1 40 3
4 50 4
5 60 7
5 49 6
6 70 8
8 80 9
8 72 1
9 90 7
....
I want to check to see if a ... |
- I need to grow an array arbitrarily large from data.
- I can guess the size (roughly 100-200) with no guarantees that the array will fit every time
- Once it is grown ...
|
I have two arrays of 2-by-2 complex matrices, and I was wondering what would be the fastest method of multiplying them. (I want to do matrix multiplication on the elements of ... |
I'm trying to sum the elements of separate data array by their characteristics efficiently. I have three identifying characteristics (age, year, and cause) in a given array, and for each ... |
Given two unordered arrays of same lengths a and b:
a = [7,3,5,7,5,7]
b = [0.2,0.1,0.3,0.1,0.1,0.2]
I'd like to group by the elements in a:
aResult = [7,3,5]
summing over the elements in b (Example used ... |
Given a numpy array A, what is the fastest/most efficient way to apply to every of each cells the same function -f- ?
- Suppose that we will assign to A(i,j) the ...
|
Numpy allows matrices of different sizes to be added/multiplied/divided provided certain broadcasting rules are followed. Also, creation of temporary arrays is a major speed impediment to ... |
There has got to be a faster way to do in place replacement of values, right? I've got a 2D array representing a grid of elevations/bathymetry. I want to ... |