About 72,700 results
Open links in new tab
  1. What is `np.ndarray [Any, np.dtype [np.float64]]` and why does `np ...

    The documentation for np.typing.NDArray says that it is "a generic version of np.ndarray[Any, np.dtype[+ScalarType]] ". Where is the generalization in "generic" happening? And in the …

  2. What is the difference between ndarray and array in NumPy?

    Apr 8, 2013 · 17 numpy.ndarray() is a class, while numpy.array() is a method / function to create ndarray. In numpy docs if you want to create an array from ndarray class you can do it with 2 …

  3. Why does numpy.ndarray allow for a "None" array? - Stack Overflow

    Jan 14, 2019 · <class 'numpy.ndarray'> >>> a == None True >>> a is None False So in this case Python seems to actually create a None array (not array of Nones), which seems to enforce a …

  4. How can I make a numpy ndarray from bytes?

    Another approach might be, if you have stored your data as records of bytes rather than as an entire ndarray and your selection of data varies from ndarray to ndarray, you can aggregate …

  5. How do I count the occurrence of a certain item in an ndarray?

    Dec 24, 2016 · How do I count the occurrence of a certain item in an ndarray? Asked 10 years, 4 months ago Modified 2 years, 6 months ago Viewed 1.2m times

  6. module 'numpy' has no attribute 'ndarray' - Stack Overflow

    Oct 12, 2021 · The problem is not with Pandas. This is due to NumPy. I had a similar issue and this is what I did. Ran python -c "import numpy as np; print(np.__file__); print(np.ndarray)". …

  7. python - How to append to a ndarray - Stack Overflow

    Jan 14, 2020 · So, I initialize my ndarray like this. A = np.array([]) And then I'm training to append into this array A a new array X which has a shape like (1000,32,32) if has any importance. …

  8. python - How to use NumPy array with ctypes? - Stack Overflow

    Your code looks like it has some confusion in it -- ctypes.POINTER() creates a new ctypes pointer class, not a ctypes instance. Anyway, the easiest way to pass a NumPy array to ctypes code …

  9. Convert NumPy array to Python list - Stack Overflow

    Jul 30, 2022 · python list numpy numpy-ndarray edited Jul 30, 2022 at 9:12 Mateen Ulhaq 27.5k 21 120 153

  10. Convert ndarray from float64 to integer - Stack Overflow

    Sep 24, 2017 · I've got an ndarray in python with a dtype of float64. I'd like to convert the array to be an array of integers. How should I do this? int() won't work, as it says it can't convert it to a …