Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

numpy diff

x = np.array([1, 2, 4, 7, 0])
np.diff(x)
array([ 1,  2,  3, -7])
np.diff(x, n=2)
array([  1,   1, -10])
Comment

PREVIOUS NEXT
Code Example
Python :: python yeild 
Python :: messagebox python pyqt 
Python :: pyqt5 qcombobox get selected item 
Python :: python advanced programs time module 
Python :: get basename without extension python 
Python :: gradient boosting regressor 
Python :: python add one month to a date 
Python :: update nested dictionary python 
Python :: how to make a clock in python 3 
Python :: get weekday from date python 
Python :: python finally keyword 
Python :: correlation for specific columns 
Python :: tkinter delete toplevel 
Python :: python open google 
Python :: ipynb import 
Python :: python string cut 
Python :: python two string equal 
Python :: python save button 
Python :: modulo python 
Python :: how to iterate over a list in python 
Python :: python euclidean distance 
Python :: python endwith 
Python :: how to let only admins do a command in discord.py 
Python :: precision and recall from confusion matrix python 
Python :: days to int 
Python :: pandas series filter by index 
Python :: python bytes 
Python :: python open directory and read files 
Python :: tkinter background image python 3 
Python :: functools reduce python 
ADD CONTENT
Topic
Content
Source link
Name
5+6 =