Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

fancy index

import numpy as np
a = np.arange(0, 30, 3)
a
# array([ 0,  3,  6,  9, 12, 15, 18, 21, 24, 27])

[a[1], a[3], a[5]]
# [3, 9, 15]

fancy = [1, 3, 5]
a[fancy]
#array([ 3,  9, 15])
Comment

PREVIOUS NEXT
Code Example
Python :: Python Pipelining Generators 
Python :: python @property decorator 
Python :: qrcode how to add logo inside python 
Python :: how to convert ordereddict to dict in python 
Python :: django models filter(x in list) 
Python :: how can you make a data fram 
Python :: Get Today’s Year, Month, and Date using today method 
Python :: pypi cryptography 
Python :: pandas pivot table margins percentage 
Python :: Fill area under line plot 
Python :: how to hide a specific file in python 
Python :: python f strings formatting numbers 
Python :: Connection to Python debugger failed: Interrupted function call: accept failed 
Python :: python lister éléments enum 
Python :: how to select the three highest entries within a category in pandas 
Python :: dimension reduction using pca 
Python :: how to add strings with entry in tkinter 
Python :: run python script from applescript 
Python :: Read a string with digits from the input and convert each number to an integer. Create a list in which you should include only odd digits. 
Python :: for con condicion 
Python :: python print install directory 
Python :: Move x-ticks to the middle of each bin 
Python :: Problème determinant algebre lineaire pdf mpsi 
Python :: python dummy command 
Python :: pyspark rdd method 
Python :: tf.io path copy 
Python :: gpt2 simple restore_from 
Python :: list loop get previous element 
Python :: python run scp command 
Python :: numpy slice double colon stack overflow 
ADD CONTENT
Topic
Content
Source link
Name
1+9 =