Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

differentate derivative differentation

# function wrt to differentate
def cu(x):
    return x*x*x

# differentation function
# Slightly increase x and compute the result. 
# Then compute the ratio of change in result with change in x
def diff(fun, x):
    delta = 0.000000001
    y = fun(x)
    x1 = x+delta
    y1 = fun(x1)
    return (y1-y) / (x1-x)

# X^3 = 3X^2
diff(cu,2)
# >>12.0
Comment

PREVIOUS NEXT
Code Example
Python :: Modifiying line plots 
Python :: matplotlib FiveThirtyEight horizontal graph 
Python :: Count total number of null, isna sum python 
Python :: hello kitt 
Python :: boto3 cross region 
Python :: Django pull from Google Sheets 
Python :: how to add another timestamp column plus two hours 
Python :: python cat binary files together 
Python :: matplotlib draw line between subplots 
Python :: how to subset a dataframe in python based on multiple categorical values 
Python :: python counting subfolders on specific level 
Python :: mechanize python fill 
Python :: calculate volume of mask 
Python :: converting string key to int py 
Python :: how to insert ele in python 
Python :: convert a python object and store it in a JSON file in the local system 
Python :: python 3 download 
Python :: # generators 
Python :: python discord bot create role 
Python :: xgb plot importance 
Python :: Big List into small chunk of lists 
Python :: fill missing values with dict 
Python :: Add OR Concatenation of Tuples in python 
Python :: maximum of a list in python recursively 
Python :: your momma in python 
Python :: docstring return list of tuple 
Python :: how to dinamically create the Q query in django 
Python :: Python NumPy ndarray flat function Example 
Python :: 123bum123 
Python :: First CGI program 
ADD CONTENT
Topic
Content
Source link
Name
9+8 =