About 120,000 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?

    Jul 30, 2022 · 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 ways as …

  3. python - NumPy array is not JSON serializable - Stack Overflow

    In the default function check if the object is from the module numpy, if so either use ndarray.tolist for a ndarray or use .item for any other numpy specific type.

  4. Type hinting / annotation (PEP 484) for numpy.ndarray

    Feb 28, 2016 · Has anyone implemented type hinting for the specific numpy.ndarray class? Right now, I'm using typing.Any, but it would be nice to have something more specific. For instance if the NumPy …

  5. why numpy.ndarray is object is not callable in my simple for python ...

    May 14, 2016 · why numpy.ndarray is object is not callable in my simple for python loop Asked 9 years, 6 months ago Modified 1 year, 2 months ago Viewed 371k times

  6. How to check if a python object is a numpy ndarray

    Mar 5, 2020 · The input array may or may not be a numpy ndarray (may be a list, pandas object, etc). In the function, I convert the input array (regardless of its type) to a numpy ndarray. But this step may be …

  7. Specific type annotation for NumPy ndarray using mypy

    Feb 24, 2021 · Support for type annotations was added in NumPy 1.20. I'm trying to figure out how to tell mypy that an array is filled with elements of a particular type, the annotation np.ndarray[np.dcomplex] …

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

    Jan 14, 2020 · Make sure to write back to A if you use np.append, as in A = np.append(A,X) -- the top-level numpy functions like np.insert and np.append are usually immutable, so even though it gives you …

  9. How to construct a ndarray from a numpy array? python

    The difference between np.ndarray and np.array is that the former is the actual type, while the latter is a flexible shorthand function for constructing arrays from data in other formats.

  10. python - How to convert ndarray to array? - Stack Overflow

    May 16, 2017 · How to convert ndarray to array? Asked 12 years, 3 months ago Modified 8 years, 6 months ago Viewed 147k times