differentiate pointwise
Project description
discrete_differentiator
Takes a series of equally spaced points, and computes the point-wise derivative.
Takes a sequence of numbers, and returns a sequence of numbers that are the derivative of the given sample.
The sequence may either be a Python array, or available in a CSV file. Differentiation is done as follows:
For first data point uses: f'(x) =(-f(x+2h) + 4*f(x+h) - 3*f(x))/(2h)
For internal data points uses: f'(x) =(f(x+h) - f(x-h))/(2h)
For last data point uses: f'(x) =(f(x-2h) - 4*f(x-h) + 3*f(x))/(2h)
Accommodates CSV files with or without column header. Also accommodates CSV files with multiple columns, of which one contains the sequence to differentiate.
Despite many parameters, simple cases are simple. Examples:
from discrete_differentiator.discrete_differentiator import DiscreteDifferentiator as DD
o DD.differentiate([2,4,6,7])
o Given a csv file foo.csv with a single column of numbers:
DD.differentiate('foo.txt')
o A csv file like this:
"trash column", 10
"more trash", 20
DD.differentiate('foo.txt', colIndex=1)
See test file for more examples.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file discrete_differentiator-0.1.tar.gz
.
File metadata
- Download URL: discrete_differentiator-0.1.tar.gz
- Upload date:
- Size: 2.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.6.1 requests/2.25.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.9.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 79cfbbf9d061fe9acf662cdf2fd968fb5ce847dd3e9f6d7fc0bc74cc291f18a5 |
|
MD5 | 10a38642a8cf81f1af81d420121cf282 |
|
BLAKE2b-256 | 9f9688a13c7b4af0e1ff020666f8500468a41445a7f650fb1269cf0c83e23191 |
File details
Details for the file discrete_differentiator-0.1-py3-none-any.whl
.
File metadata
- Download URL: discrete_differentiator-0.1-py3-none-any.whl
- Upload date:
- Size: 1.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.6.1 requests/2.25.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.9.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d5171173f8c696e4c53bac990d3bc1cc14dd9dab5d800fd814a693e3ef6bbd92 |
|
MD5 | b3f4354a111d4144764f450821b753d9 |
|
BLAKE2b-256 | 261dbea2bdda68df2d18d48f3c4880390763d08db5a999a7b8d5145e4feaa2c5 |