About 13,300,000 results
Open links in new tab
  1. python - Why does += behave unexpectedly on lists? - Stack …

    177 The += operator in python seems to be operating unexpectedly on lists. Can anyone tell me what is going on here?

  2. slice - How slicing in Python works - Stack Overflow

    The colon, :, is what tells Python you're giving it a slice and not a regular index. That's why the idiomatic way of making a shallow copy of lists in Python 2 is

  3. python - List vs tuple, when to use each? - Stack Overflow

    In Python, when should you use lists and when tuples? Sometimes you don't have a choice, for example if you have "hello %s you are %s years old" % x then x must be a tuple. But if I am …

  4. What are the advantages of NumPy over regular Python lists?

    NumPy's arrays are more compact than Python lists -- a list of lists as you describe, in Python, would take at least 20 MB or so, while a NumPy 3D array with single-precision floats in the …

  5. python - All combinations of a list of lists - Stack Overflow

    Closed 3 years ago. I'm basically looking for a python version of Combination of List<List<int>> Given a list of lists, I need a new list that gives all the possible combinations of items between …

  6. Difference between del, remove, and pop on lists in Python

    Difference between del, remove, and pop on lists in Python Asked 13 years, 5 months ago Modified 1 year, 10 months ago Viewed 2.1m times

  7. python - How to get the Cartesian product of multiple lists - Stack ...

    Mar 19, 2019 · One common application for this technique is to avoid deeply nested loops. See Avoiding nested for loops for a more specific duplicate. Similarly, this technique might be used …

  8. In Python, when to use a Dictionary, List or Set?

    Jul 1, 2019 · 1 Dictionary: A python dictionary is used like a hash table with key as index and object as value. List: A list is used for holding objects in an array indexed by position of that …

  9. python - Element-wise addition of 2 lists? - Stack Overflow

    Sep 10, 2013 · 6 This will work for 2 or more lists; iterating through the list of lists, but using numpy addition to deal with elements of each list

  10. What is the difference between Python's list methods append and …

    Oct 31, 2008 · 1) The difference between append and extend append: Appends any Python object as-is to the end of the list (i.e. as a the last element in the list). The resulting list may be …