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.

Go sort a slice of runes?

I'm having trouble sorting strings by character (to check whether two strings are anagrams, I want to sort both of …

string sorting go slice rune
Python Pandas slice multiindex by second level index (or any other level)

There are many postings on slicing the level[0] of a multiindex by a range of level1. However, I cannot find …

python sorting pandas slice multi-index
substr() with negative value not working in IE

EDIT:I've changed the title, because the issue had nothing to do with IE image.load() firing - my substr() …

javascript onload explorer slice substr
Idiomatic sequence slice in Clojure

In Python, there is a convenient way of taking parts of a list called "slicing": a = [1,2,3,4,5,6,7,8,9,10] # ≡ a = range(1,10) a[:3] # get …

clojure sequence slice
TypeError: cannot do slice indexing on <class 'pandas.indexes.numeric.Int64Index'> with these indexers [(2,)] of <class 'tuple'>

I've a user defined function as follows:- def genre(option,option_type,*limit): option_based = rank_data.loc[rank_…

python python-3.x pandas slice argument-unpacking
Slicing a Python OrderedDict

In my code I frequently need to take a subset range of keys+values from a Python OrderedDict (from collections …

python-2.7 slice ordereddictionary
Is there analog of memset in go?

In C++ I can initialize an array with some value using memset: const int MAX = 1000000; int is_prime[MAX] memset(…

go slice memset
np.delete and np.s_. What's so special about np_s?

I don't really understand why regular indexing can't be used for np.delete. What makes np.s_ so special? For …

python-2.7 numpy indexing slice delete-row
Numpy - slicing 2d row or column vector from array

I'm trying to find a neat little trick for slicing a row/column from a 2d array and obtaining an …

python arrays numpy slice reshape
spread syntax vs slice method

I was trying to understand what is the difference between spread syntax vs slice method in the following approach. suppose …

javascript slice spread-syntax