About 50 results
Open links in new tab
  1. How do I declare an array in Python? - Stack Overflow

    Aug 23, 2022 · There's no way to say in Python "this variable should never refer to anything other than a list", since Python is dynamically typed. * The default built-in Python type is called a list, not an array. …

  2. python - What's the type hint for an array? - Stack Overflow

    May 31, 2021 · For most collections we can do: from typing import List, Tuple, etc Is there a hint for array? As in: arr = array.array('i')

  3. Python "array-type" data for beginners - Stack Overflow

    Mar 19, 2015 · 2 There are three common array types I'll mention here: list and tuple, which are built-in and documented here (along with some others), and numpy.array. List Lists are built-in, mutable …

  4. How to create array of the certain type in python

    Feb 1, 2011 · How do you create an array of defined length of the certain type in python? To be precise I am trying to create an array of handles that is able to hold up to 1024 records.

  5. python - check type within numpy array - Stack Overflow

    An array is an object of type np.ndarray. Its values or elements are stored in a data buffer, which can be thought of as a contiguous block of memory bytes. The bytes in the data buffer do not have a type, …

  6. 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 …

  7. Python list vs. array – when to use? - Stack Overflow

    Aug 17, 2022 · The list is the part of python's syntax so it doesn't need to be declared whereas you have to declare the array before using it. You can store values of different data-types in a list …

  8. How to create an integer array in Python? - Stack Overflow

    Dec 7, 2009 · Python doesn't have a built-in array data structure. The closest you get to that are lists.

  9. python - Is there a way to set "array of strings" as a type for a ...

    May 2, 2019 · I want to check right at the passing of the arguments to a function if the argument is an array of strings. Like setting a type to the parameter of the function to "array of string". But I don't ...

  10. python - Type hinting for array-like - Stack Overflow

    Mar 16, 2022 · What would be the correct type hint for a function that accepts an one dimensional array-like object? More specifically, my function uses np.percentile and I would like to 'match' np.percentile …