Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

numpy fancy indexing

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 :: raspberry pi pwm controlled leds 
Python :: const obj = { a: 1, b: 2, c: 3, }; const obj2 = { ...obj, a: 0, }; console.log(obj2.a, obj2.b); 
Python :: pandas replace not working 
Python :: Pandas dataframe with MultiIndex: check if string is contained in index level 
Python :: ascci value pyth 
Python :: Errors that you will get in the Time class in Python DateTime 
Python :: pypi cryptography 
Python :: Get index for value_counts() 
Python :: python pynput hotkeys 
Python :: fetchall in python sqilite3 
Python :: Generate bootstrap replicate of 1D data that return a particular operation on a range 
Python :: poisson random data 
Python :: dynamic id python 
Python :: sample regression algorithm using pipeline with hyperparameter tuning 
Python :: axes in array 
Python :: if you have a list and the user input one of the keys then output its value 
Python :: fastai read data from image folders 
Python :: find difference between two triangular numbers python 
Python :: Como hacer mayusculas un string 
Python :: real numbers python 
Python :: 1043 uri solution 
Python :: how to access github folder in python code using github https link 
Python :: find mean of list python 
Python :: expecting property name enclosed in double quotes json 
Python :: duur wordt voor woorden kennis 
Python :: iptc text classification example 
Python :: frogenset ito list pandas 
Python :: cumulative chart python plotly 
Python :: django clodinarystorage 
Python :: best movies to watch once in lifetime 2000 
ADD CONTENT
Topic
Content
Source link
Name
3+4 =