About 50 results
Open links in new tab
  1. How do I get the number of elements in a list (length of a list) in Python?

    Nov 11, 2009 · Explanation Everything in Python is an object, including lists. All objects have a header of some sort in the C implementation. Lists and other similar builtin objects with a "size" in Python, in …

  2. How do I determine the size of an object in Python?

    660 How do I determine the size of an object in Python? The answer, "Just use sys.getsizeof ", is not a complete answer. That answer does work for builtin objects directly, but it does not account for what …

  3. Size of a Python list in memory - Stack Overflow

    List with one element When a list with a single element [1] is created, space for one element is allocated in addition to the memory required by the list data structure itself. Again, this can be found in …

  4. How to see sizes of installed pip packages? - Stack Overflow

    On Linux Debian, how can I list all installed python pip packages and the size (amount of disk space used) that each one takes up?

  5. python - How do I split a list into equally-sized chunks ... - Stack ...

    How do I split a list of arbitrary length into equal sized chunks? See also: How to iterate over a list in chunks. To chunk strings, see Split string every nth character?.

  6. How Big can a Python List Get? - Stack Overflow

    May 12, 2009 · In Python, how big can a list get? I need a list of about 12000 elements. Will I still be able to run list methods such as sorting, etc?

  7. python - Type hint for a Sequence or list with known length - Stack ...

    A simple example: a list representing a range [start, stop] where bounds are updatable. There is actually a shortcut for a fixed number of repetitions: Tuple[(int,)*3] is equivalent to Tuple[int, int, int] @Retr0id …

  8. python - How to find length of a multi-dimensional list ... - Stack ...

    Apr 14, 2013 · 7 How do you find the length of a multi-dimensional list? I've come up with a way myself, but is this the only way to find the number of values in a multi-dimensional list?

  9. Create an empty list with certain size in Python - Stack Overflow

    How do I create an empty list that can hold 10 elements? After that, I want to assign values in that list. For example: xs = list() for i in range(0, 9): xs[i] = i However, that gives IndexError:

  10. python 3.x - Difference between len and size - Stack Overflow

    Aug 28, 2019 · But len() will return 5, because the number of elements in higher order list (or 1st dimension is 5). According to your question, len() and numpy.size() return same output for 1-D arrays …