About 50 results
Open links in new tab
  1. How do numpy's in-place operations (e.g. `+=`) work?

    May 4, 2016 · I don't know what's going on under the hood, but in-place operations on items in NumPy arrays and in Python lists will return the same reference, which IMO can lead to confusing results …

  2. How to perform element-wise Boolean operations on NumPy arrays

    How to perform element-wise Boolean operations on NumPy arrays [duplicate] Asked 14 years, 1 month ago Modified 4 years, 4 months ago Viewed 161k times

  3. When do numpy arrays become more efficient than python lists for …

    Aug 14, 2022 · numpy arrays are faster when using the compiled methods and functions - that is when the iteration and access is done in c. Python level iteration on arrays is slower. The elements of an …

  4. Numpy is very slow for basic array operations - Stack Overflow

    Apr 8, 2019 · The speedup from using NumPy comes when you perform "vectorized" operations on entire arrays (or subsets of arrays). Try assigning the first 10000 elements of a NumPy array to be …

  5. python - Why are NumPy arrays so fast? - Stack Overflow

    Numpy arrays are densely packed arrays of homogeneous type. Python lists, by contrast, are arrays of pointers to objects, even when all of them are of the same type. So, you get the benefits of locality of …

  6. Applying string operations to numpy arrays? - Stack Overflow

    Aug 1, 2013 · 17 Yes, recent NumPy has vectorized string operations, in the numpy.char module. E.g., when you want to find all strings starting with a B in an array of strings, that's

  7. python - Are element-wise operations faster with NumPy functions …

    Sep 13, 2014 · I recently came across a great SO post in which a user suggests that numpy.sum is faster than Python's sum when it comes to dealing with NumPy arrays. This made me think, are …

  8. What are the advantages of NumPy over regular Python lists?

    A NumPy array is an array of uniform values -- single-precision numbers takes 4 bytes each, double-precision ones, 8 bytes. Less flexible, but you pay substantially for the flexibility of standard Python lists!

  9. python - Array elementwise operations - Stack Overflow

    Dec 6, 2014 · Using numpy.vectorize lets you use your element-by-element function to create your own ufunc, which works the same way as other NumPy ufuncs (like standard addition, etc.): the ufunc will …

  10. Improving performance of operations on a NumPy array

    May 15, 2012 · avoiding the delete operations (which cause a copy of the original array) NumPy 1.7 introduced a new mask that is far easier to use than the original; it's performance is also much better …