Using finite Difference
import numpy as np
def deriv(x,y):
return np.diff(y)/np.diff(x)
Sometime in a project to run or build it you need to run multiple commands depending on the files that are present. This sometime is cumbersome and typing the same long command again and again is tedious. Having a Makefile can save the day. You can save your code in a makefile and then just type make in the terminal to run it.
Content in the makefile is very simple. The basic structure is
target: dependencies
command