About 51 results
Open links in new tab
  1. slice - How slicing in Python works - Stack Overflow

    Python slicing is a computationally fast way to methodically access parts of your data. In my opinion, to be even an intermediate Python programmer, it's one aspect of the language that it is necessary to …

  2. what does [::-1] mean in python - slicing? - Stack Overflow

    10 Slicing Negative numbers for start and stop mean "from the end". It's essianlly equivalent of len-value. Negative number for step means "in reverse order". Empty start means 0 i.e. 1st element. …

  3. How to slice a list in Python - Stack Overflow

    This is commonly known as slicing. This creates a new list, it doesn't trim the existing one. To trim in-place, use del on a slice; e.g. del listobj[-x:] will remove the last x elements from the list object.

  4. Python: slicing a multi-dimensional array - Stack Overflow

    Feb 27, 2023 · Python's slicing also doesn't support 2D/multi-dimensional slicing for lists. The expected output for slicing a multi-dimensional list can be tricky. For example, If you want the third column …

  5. c++ - What is object slicing? - Stack Overflow

    Nov 8, 2008 · The slicing problem in C++ arises from the value semantics of its objects, which remained mostly due to compatibility with C structs. You need to use explicit reference or pointer syntax to …

  6. Slicing un lista en python - Stack Overflow en español

    Feb 6, 2022 · Cuando haces letters[1:] efectivamente estás seleccionando todos los componentes de una lista desde el 1 en adelante (es decir, todos menos el primero) y estás en lo correcto en suponer …

  7. How to slice a list from an element n to the end in Python?

    To my understanding, slice means lst[start:end], and including start, excluding end. So how would I go about finding the "rest" of a list starting from an element n?

  8. python - Implementing slicing in __getitem__ - Stack Overflow

    The __getitem__() method will receive a slice object when the object is sliced. Simply look at the start, stop, and step members of the slice object in order to get the components for the slice.

  9. Extracting a region from an image using slicing in Python, OpenCV

    Oct 9, 2016 · I can't figure it out how to do it in color. I thought of extracting each channel R, G, B; slicing this region from each of the channels and to merge them back together but there is gotta be a …

  10. python - Slicing the second last character - Stack Overflow

    Sep 3, 2022 · Im new to slicing and I only know how to slice from the start and from the end but not somewhere between, not even sure if that is possible. could someone tell me how I can slice this …