About 855,000 results
Open links in new tab
  1. python - How do I select elements of an array given condition? - Stack ...

    Learn how to select elements from an array based on specific conditions using various programming techniques and examples in this comprehensive guide.

  2. How do I read CSV data into a record array in NumPy?

    Aug 19, 2010 · data_array = np.asarray(data, dtype = <whatever options>) on 4.6 million rows with about 70 columns and found that the NumPy path took 2 min 16 secs and the csv-list comprehension …

  3. python - array.array versus numpy.array - Stack Overflow

    Sep 21, 2008 · Numpy is also much more flexible, e.g. it supports arrays of any type of Python objects, and is also able to interact "natively" with your own objects if they conform to the array interface.

  4. How do I remove NaN values from a NumPy array? - Stack Overflow

    Jul 23, 2012 · x = x[~numpy.isnan(x)] Explanation The inner function numpy.isnan returns a boolean/logical array which has the value True everywhere that x is not-a-number. Since we want …

  5. python - Numpy array dimensions - Stack Overflow

    Jun 17, 2010 · In Numpy, dimension, axis/axes, shape are related and sometimes similar concepts: dimension In Mathematics/Physics, dimension or dimensionality is informally defined as the minimum …

  6. Convert NumPy array to Python list - Stack Overflow

    Dec 27, 2009 · Note that this converts the values from whatever numpy type they may have (e.g. np.int32 or np.float32) to the "nearest compatible Python type" (in a list). If you want to preserve the …

  7. python - Using NumPy to build an array of all combinations of two ...

    My function takes float values given in a 6-dim NumPy array as input. What I tried to do initially was this: First, I created a function that takes two arrays and generate an array with all combinations of values …

  8. How do I create an empty array and then append to it in NumPy?

    I want to create an empty array and append items to it, one at a time. xs = [] for item in data: xs.append(item) Can I use this list-style notation with NumPy arrays?

  9. python - Is there a NumPy function to return the first index of ...

    Jan 11, 2009 · I know there is a method for a Python list to return the first index of something: >>> xs = [1, 2, 3] >>> xs.index (2) 1 Is there something like that for NumPy arrays?

  10. python - Find nearest value in numpy array - Stack Overflow

    Apr 2, 2010 · How do I find the nearest value in a numpy array? Example: np.find_nearest(array, value)