Top "Slice" questions

A slice is a representation of a part of a sequence, usually defined by a reference to the underlying sequence, an index giving the starting position, a length or end position, and optionally a "stride" or "step" value.

What is a slice in Swift?

What is a slice in Swift and how does it differ from an array? From the documentation, the type signature …

swift slice
Pandas selecting by label sometimes return Series, sometimes returns DataFrame

In Pandas, when I select a label that only has one entry in the index I get back a Series, …

python pandas dataframe slice series
Pandas slicing FutureWarning with 0.21.0

I'm trying to select a subset of a subset of a dataframe, selecting only some columns, and filtering on the …

python pandas filter slice
What's the point of .slice(0) here?

I was studying the jQuery source when I found this (v1.5 line 2295): namespace = new RegExp("(^|\\.)" + jQuery.map( namespaces.slice(0).sort(), …

javascript jquery type-conversion slice
Are golang slices passed by value?

In Golang, I am trying to make a scramble slice function for my traveling salesman problem. While doing this I …

go slice pass-by-value
Python Array Slice With Comma?

I was wondering what the use of the comma was when slicing Python arrays - I have an example that …

python list numpy slice
Is it possible to initialize slice with specific values?

Is it possible to initialize an slice with all 1's like in python? PYTHON: onesArray = np.ones(5) onesList = [1]*5 GOLANG onesSlice := …

go slice
Python list error: [::-1] step on [:-1] slice

I thought I understood the basics of list slicing in python, but have been receiving an unexpected error while using …

python slice reverse
How to idiomatically copy a slice?

In Go, copying slices is standard-fare and looks like this: # It will figure out the details to match slice sizes …

rust slice
Slice of slices types

I'm currently working my way through the excellent Tour of Go. I finished one of the exercises (#45) with the following …

types go slice