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.

Slicing Sparse Matrices in Scipy -- Which Types Work Best?

The SciPy Sparse Matrix tutorial is very good -- but it actually leaves the section on slicing un(der)developed (…

python indexing scipy sparse-matrix slice
Plot data values inside pie charts slice

How to add a data values inside the slice in pie chart. Can any one help me in this? whether …

highcharts slice pie-chart
python pandas select both head and tail

For a DataFrame in Pandas, how can I select both the first 5 values and last 5 values? For example In [11]: df …

python pandas slice tail head
How to check if a slice has a given index in Go?

We can easily do that with maps: item, ok := myMap["index"] But not with slices: item, ok := mySlice[3] // panic! Surprised …

go slice
Best way to swap variable values in Go?

Is it possible to swap elements like in python? a,b = b,a or do we have to use: temp = …

go slice swap
Why are slice and range upper-bound exclusive?

Disclaimer: I am not asking if the upper-bound stopargument of slice()and range() is exclusive or how to use these …

python language-design slice
How do I slice an array from an array of object literals?

I have this array, in which each index contains an object literal. All of the object literals have the same …

javascript arrays sorting slice object-literal
cap vs len of slice in golang

What is the difference between cap and len of a slice in golang? According to definition: A slice has both …

go slice
A question about JavaScript's slice and splice methods

I came across the following code: var f = function () { var args = Array.prototype.slice.call(arguments).splice(1); // some more code }; …

javascript arrays slice splice arguments
How to slice a deque?

I've changed some code that used a list to using a deque. I can no longer slice into it, as …

python slice deque