About 20,800,000 results
Open links in new tab
  1. slice - How slicing in Python works - Stack Overflow

    Understanding the difference between indexing and slicing: Wiki Python has this amazing picture which clearly distinguishes indexing and slicing. It is a list with six elements in it. To …

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

    The method you used is called Slicing in Python. Slicing syntax in python is as follows, [ <first element to include> : <first element to exclude> : <step> ] where adding the step part is …

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

    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. c++ - What is object slicing? - Stack Overflow

    Nov 8, 2008 · 7 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 …

  5. How to get last items of a list in Python? - Stack Overflow

    108 Slicing Python slicing is an incredibly fast operation, and it's a handy way to quickly access parts of your data. Slice notation to get the last nine elements from a list (or any other …

  6. python - Slicing of a NumPy 2d array, or how do I extract an mxm ...

    Nov 23, 2010 · Slicing of a NumPy 2d array, or how do I extract an mxm submatrix from an nxn array (n>m)? Asked 15 years ago Modified 7 years, 3 months ago Viewed 270k times

  7. Understanding string reversal via slicing - Stack Overflow

    It's using extended slicing - a string is a sequence in Python, and shares some methods with other sequences (namely lists and tuples). There are three parts to slicing - start, stop and step.

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

  9. How to take column-slices of dataframe in pandas

    May 19, 2012 · Here's how you could use different methods to do selective column slicing, including selective label based, index based and the selective ranges based column slicing.

  10. How can I slice a string in c#? - Stack Overflow

    Jan 5, 2014 · string word = "hello"; So what I want to do is slice the string so that I can print, for example, elloh to the console window. In python it's so simple but I'm not sure if there's a …