performance « numpy « Python Data Type Q&A

Home
Python Data Type Q&A
1.array
2.date
3.dictionary
4.Format
5.integer
6.List
7.numpy
8.regex
9.string
10.tuple
Python Data Type Q&A » numpy » performance 

1. List comprehension, map, and numpy.vectorize performance    stackoverflow.com

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 ...

2. List of objects or parallel arrays of properties?    stackoverflow.com

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 ...

3. How do I maximize efficiency with numpy arrays?    stackoverflow.com

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 ...

4. Sum one row of a NumPy array    stackoverflow.com

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 ...

5. Speed up a program that calculate the average of the neighbors in a huge array    stackoverflow.com

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 ...

6. numpy arrays: filling and extracting data quickly    stackoverflow.com

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 ...

7. Python/Numpy - Quickly Find the Index in an Array Closest to Some Value    stackoverflow.com

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 ...

8. Why is numpy.array so slow?    stackoverflow.com

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    ...

9. Efficient Datatype Python (list or numpy array?)    stackoverflow.com

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 ...

10. How to avoid copy of a non-global numpy array between process?    stackoverflow.com

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 ...

11. Performance of NumPy for algorithms concerning individual elements of an array    stackoverflow.com

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 ...

12. What is the most efficient way to check if a value exists in a NumPy array?    stackoverflow.com

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 ...

13. Fastest way to grow a numpy numeric array    stackoverflow.com

  • 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 ...

14. Fastest way to multiply arrays of matrices in Python (numpy)    stackoverflow.com

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 ...

15. Cycling through array elements efficiently in python    stackoverflow.com

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 ...

16. Python group by array a, and summarize array b - Performance    stackoverflow.com

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 ...

17. Efficient evaluation of a function at every cell of a Numpy array    stackoverflow.com

Given a numpy array A, what is the fastest/most efficient way to apply to every of each cells the same function -f- ?

  1. Suppose that we will assign to A(i,j) the ...

18. Optimal (broadcasted) matrix division in numpy. Avoiding temporary arrays or not?    stackoverflow.com

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 ...

19. Fast in-place replacement of some values in a numpy array    stackoverflow.com

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 ...

java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.