About 50 results
Open links in new tab
  1. python - How to use np.vectorize? - Stack Overflow

    Feb 13, 2021 · Isn't the answer to How to use np.vectorize? usually "Don't. It just pretends to be a vectorized function but is just a loop with a different name"?

  2. simd - What is "vectorization"? - Stack Overflow

    Sep 14, 2009 · Many CPUs have "vector" or "SIMD" instruction sets which apply the same operation simultaneously to two, four, or more pieces of data. Modern x86 chips have the SSE instructions, …

  3. Using Numpy Vectorize on Functions that Return Vectors

    The purpose of np.vectorize is to transform functions which are not numpy-aware (e.g. take floats as input and return floats as output) into functions that can operate on (and return) numpy arrays.

  4. How can I vectorize an image using Python? - Stack Overflow

    Dec 15, 2021 · How can I convert an image to a vectorised form? Normal image: Vectorised Image: I implemented image segmentation using the SLIC method. The result is close to the desired outcome …

  5. python - Performance of Pandas apply vs np.vectorize to create new ...

    Oct 6, 2018 · I am using Pandas dataframes and want to create a new column as a function of existing columns. I have not seen a good discussion of the speed difference between df.apply() and …

  6. How do I vectorize a function with Numba, when the function takes ...

    Jul 17, 2018 · I'd like to use Numba to vectorize a function that will evaluate each row of a matrix. This would essentially apply a Numpy ufunc to the matrix, as opposed to looping over the rows. According …

  7. cannot call `vectorize` on size 0 inputs unless `otypes` is set

    Nov 17, 2021 · cannot call `vectorize` on size 0 inputs unless `otypes` is set Asked 4 years, 1 month ago Modified 4 years, 1 month ago Viewed 9k times

  8. python - How to vectorize a torch function? - Stack Overflow

    Sep 20, 2022 · When using numpy I can use np.vectorize to vectorize a function that contains if statements in order for the function to accept array arguments. How can I do the same with torch in …

  9. Most efficient way to map function over numpy array

    Feb 5, 2016 · What is the most efficient way to map a function over a numpy array? I am currently doing: import numpy as np x = np.array ( [1, 2, 3, 4, 5]) # Obtain array of square ...

  10. c++ - What does vectorization mean? - Stack Overflow

    Oct 4, 2009 · Is it a good idea to vectorize the code? What are good practices in terms of when to do it? What happens underneath?