DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
SCRIPT & CODE EXAMPLE
CODE EXAMPLE FOR PYTHON
return position of a unique value in python array
def partition(array): return {i: (array == i).nonzero()[0] for i in np.unique(array)}
Source by stackoverflow.com #
PREVIOUS
NEXT
Tagged:
#return
#position
#unique
#python
#array
ADD COMMENT
Topic
COMMENT
Name
6+4 =
Submit