numspark


Namenumspark JSON
Version 1.2 PyPI version JSON
download
home_pagehttps://github.com/Sahil-Rajwar-2004/NumSpark
SummaryA math library for python
upload_time2023-08-07 20:30:15
maintainer
docs_urlNone
authorSahil Rajwar
requires_python
license
keywords math library numpy-alternative sci-calc calc
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # NumSpark (Version 1.2)

NumSpark is a Python library that provides mathematical operations and functions for numerical calculations. It includes operations on lists, vectors, matrices, sets, and various mathematical functions.

## Installation and Dependencies
```bash
pip install numspark
```
```text
numpy
sympy
```


## Constants

NumSpark provides the following constants:

- **`PI`**: The mathematical constant π (pi).
- **`E`**: The mathematical constant e (base of the natural logarithm).
- **`INFINITY`**, **`INF`**, **`inf`**: Represents positive infinity.
- **`NAN`**, **`NaN`**, **`nan`**: Represents not a number.
- **`TRUE`**, **`true`**: Represents the boolean value True.
- **`FALSE`**, **`false`**: Represents the boolean value False.
- **`NONE`**, **`NULL`**, **`none`**, **`null`**: Represents None or null.

## List Operations

The **`List`** class provides various element-wise operations on lists:

- **`element_wise_operation`**: Perform an element-wise operation on multiple lists.
- **`product`**: Compute the element-wise product of multiple lists.
- **`scalarProduct`**: Multiply each element of a list by a scalar value.
- **`add`**: Compute the element-wise addition of multiple lists.
- **`scalarAdd`**: Add a scalar value to each element of a list.
- **`sub`**: Compute the element-wise subtraction of multiple lists.
- **`scalarSub`**: Subtract a scalar value from each element of a list.
- **`div`**: Compute the element-wise division of multiple lists.
- **`scalarDiv`**: Divide each element of a list by a scalar value.
- **`floorDiv`**: Compute the element-wise floor division of multiple lists.
- **`scalarFloorDiv`**: Perform floor division of each element of a list by a scalar value.
- **`modulo`**: Compute the element-wise modulo operation of multiple lists.
- **`scalarModulo`**: Perform modulo operation on each element of a list with a scalar value.
- **`pow`**: Compute the element-wise power of a list with a scalar value.
- **`flatten`**: Flatten a nested list to a single list.

## Vector Operations

The **`Vector`** class provides operations on 3-dimensional vectors:

- **`add`**: Add multiple 3-dimensional vectors.
- **`sub`**: Subtract multiple 3-dimensional vectors.
- **`crossProduct`**: Compute the cross product of multiple 3-dimensional vectors.
- **`dotProduct`**: Compute the dot product of multiple 3-dimensional vectors.
- **`magnitude`**: Compute the magnitude of a 3-dimensional vector.
- **`projection`**: Compute the projection of one 3-dimensional vector onto another.
- **`angleOfProjection`**: Compute the angle of projection between two 3-dimensional vectors.

## Matrix Operations

The **`Matrix`** class provides operations on matrices:

- **`isMatrix`**: Check if a given nested list is a matrix.
- **`isSquare`**: Check if a given matrix is square.
- **`add`**: Add multiple matrices element-wise.
- **`scalarAdd`**: Add a scalar value to each element of a matrix.
- **`sub`**: Subtract multiple matrices element-wise.
- **`scalarSub`**: Subtract a scalar value from each element of a matrix.
- **`product`**: Multiply multiple matrices.
- **`scalarProduct`**: Multiply each element of a matrix by a scalar value.
- **`T`**: Transpose a matrix.
- **`subMatrix`**: Extract a submatrix by removing a specific row and column from the original matrix.
- **`det`**: Calculate the determinant of a square matrix.
- **`cofactor`**: Calculate the cofactors of a square matrix.
- **`adjoint`**: Calculate the adjoint (adjugate) of a square matrix.
- **`inv`**: Calculate the inverse of a square matrix.
- **`traces`**: Calculate the sum of the diagonal elements of a square matrix.
- **`diagonalSum`**: Calculate the sum of the diagonal and anti-diagonal elements of a square matrix.
- **`removeCol`**: Remove a specific column from a matrix.
- **`removeRow`**: Remove a specific row from a matrix.
- **`reciprocal`**: Calculate the reciprocal of each element in a matrix.

## Set Operations

The **`Set`** class provides operations on sets:

- **`toSet`**: Convert a list to a set, removing duplicates.
- **`intersect`**: Compute the intersection of multiple sets.
- **`union`**: Compute the union of multiple sets.
- **`belongsTo`**: Check if an element belongs to a set.
- **`subSet`**: Check if one set is a subset of another.

## Mathematical Functions

NumSpark includes various **mathematical** functions:

- **`max`**: Find the maximum value in an array.
- **`min`**: Find the minimum value in an array.
- **`sin`**: Compute the sine of an angle (in radians or degrees).
- **`cos`**: Compute the cosine of an angle (in radians or degrees).
- **`tan`**: Compute the tangent of an angle (in radians or degrees).
- **`cot`**: Compute the cotangent of an angle (in radians or degrees).
- **`cosec`**: Compute the cosecant of an angle (in radians or degrees).
- **`sec`**: Compute the secant of an angle (in radians or degrees).
- **`asin`**: Compute the arcsine of an angle (in radians).
- **`acos`**: Compute the arccosine of an angle (in radians).
- **`atan`**: Compute the arctangent of an angle (in radians).
- **`acot`**: Compute the arccotangent of an angle (in radians).
- **`acosec`**: Compute the arccosecant of an angle (in radians).
- **`asec`**: Compute the arcsecant of an angle (in radians).
- **`sqrt`**: Compute the square root of a number.
- **`cbrt`**: Compute the cube root of a number.
- **`power`**: Compute the power of a number with a given exponent.
- **`exp`**: Compute the exponential function of a number.
- **`factorial`**: Compute the factorial of a number.
- **`fibSequence`**: Generate a Fibonacci sequence up to a given number.
- **`floor`**: Round a number down to the nearest integer.
- **`ceil`**: Round a number up to the nearest integer.
- **`quadratic_roots`**: Calculate the roots of a quadratic equation.
- **`log`**: Compute the logarithm of a number (base 10).
- **`ln`**: Compute the natural logarithm of a number (base e).
- **`logn`**: Compute the logarithm of a number with a specified base.
- **`permutation`**: Calculate the number of permutations of `n` objects taken `r` at a time.
- **`combination`**: Calculate the number of combinations of `n` objects taken `r` at a time.
- **`product`**: Compute the product of elements in an array.
- **`summation`**: Compute the sum of elements in an array.
- **`mean`**: Calculate the arithmetic mean (average) of an array.
- **`median`**: Calculate the median of an array.
- **`mode`**: Calculate the mode of an array.
- **`variance`**: Calculate the variance of an array (sample or population).
- **`standard_deviation`**: Calculate the standard deviation of an array (sample or population).
- **`skewness`**: Calculate the skewness of an array.
- **`kurtosis`**: Calculate the kurtosis of an array.
- **`geometric_mean`**: Calculate the geometric mean of an array
- **`harmonic_mean(array: list)`**: Calculates the harmonic mean of a list of numbers.
- **`correlation_coefficient(x: list, y: list)`**: Computes the correlation coefficient between two lists of numbers.
- **`slope_intercept(array1: list, array2: list)`**: Calculates the slope and intercept of the linear regression line for two arrays of data points.
- **`moving_average(array: list, steps: int)`**: Computes the moving average of a list of numbers using a given window size.
- **`exponential_moving_average(array: list, alpha: int|float)`**: Calculates the exponential moving average of a list of numbers using a smoothing factor `alpha`.
- **`mean_sqrd_error(actual: list, predicted: list)`**: Computes the mean squared error between two lists of actual and predicted values.
- **`root_mean_sqrd_error(actual: list, predicted: list)`**: Calculates the root mean squared error between two lists of actual and predicted values.
- **`errors(actual: list, predicted: list)`**: Calculates the errors (differences) between two lists of actual and predicted values.
- **`mean_error(actual: list, predicted: list)`**: Computes the mean error (average of errors) between two lists of actual and predicted values.
- **`power(base: int|float, exponent: int|float)`**: Raises the base to the power of the exponent.
- **`power_sum(array: list, exponent: int|float)`**: Computes the sum of the elements in the array raised to the power of the given exponent.
- **`power_array(array: list, exponent: int|float)`**: Generates a new list with elements from the input list raised to the power of the given exponent.
- **`primes(limit: int)`**: Generates a list of prime numbers up to a given limit.
- **`isprime(number: int)`**: Checks if a given number is prime.
- **`cost_function(actual: list, predicted: list)`**: Computes the cost function (mean squared error) between two lists of actual and predicted values for a regression problem.
- **`scaling(array: list, feature_range: tuple = (0, 1))`**: Scales the values in the array to a specified feature range (default 0 to 1).
- **`gaussian(array: list)`**: Generates a list of values representing the Gaussian distribution based on the input data.
- **`sigmoid(x: int)`**: Computes the sigmoid function for a given input.
- **`zscore(array: list, number: int) -> int|float`**: Calculates the z-score of a given number in relation to a list of data.
- **`euclidean_distance(array1: list, array2: list)`**: Calculates the Euclidean distance between two lists of coordinates (2D).
- **`manhattan_distance(array1: list, array2: list)`**: Computes the Manhattan distance between two lists of coordinates (2D).
- **`camberra_distance(array1: list, array2: list)`**: Calculates the Canberra distance between two lists of coordinates (2D).
- **`integrate(expression: str, wrt: str = "x")`**: Performs symbolic integration of a given expression with respect to the specified variable.
- **`derivate(expression: str, wrt: str = "x")`**: Performs symbolic differentiation of a given expression with respect to the specified variable.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Sahil-Rajwar-2004/NumSpark",
    "name": "numspark",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "math library numpy-alternative sci-calc calc",
    "author": "Sahil Rajwar",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/73/e7/cdf316ada0aa5f314118d041438234c0780c915e3971241a43fc8fe348ee/numspark-1.2.tar.gz",
    "platform": null,
    "description": "# NumSpark (Version 1.2)\r\n\r\nNumSpark is a Python library that provides mathematical operations and functions for numerical calculations. It includes operations on lists, vectors, matrices, sets, and various mathematical functions.\r\n\r\n## Installation and Dependencies\r\n```bash\r\npip install numspark\r\n```\r\n```text\r\nnumpy\r\nsympy\r\n```\r\n\r\n\r\n## Constants\r\n\r\nNumSpark provides the following constants:\r\n\r\n- **`PI`**: The mathematical constant \u03c0 (pi).\r\n- **`E`**: The mathematical constant e (base of the natural logarithm).\r\n- **`INFINITY`**, **`INF`**, **`inf`**: Represents positive infinity.\r\n- **`NAN`**, **`NaN`**, **`nan`**: Represents not a number.\r\n- **`TRUE`**, **`true`**: Represents the boolean value True.\r\n- **`FALSE`**, **`false`**: Represents the boolean value False.\r\n- **`NONE`**, **`NULL`**, **`none`**, **`null`**: Represents None or null.\r\n\r\n## List Operations\r\n\r\nThe **`List`** class provides various element-wise operations on lists:\r\n\r\n- **`element_wise_operation`**: Perform an element-wise operation on multiple lists.\r\n- **`product`**: Compute the element-wise product of multiple lists.\r\n- **`scalarProduct`**: Multiply each element of a list by a scalar value.\r\n- **`add`**: Compute the element-wise addition of multiple lists.\r\n- **`scalarAdd`**: Add a scalar value to each element of a list.\r\n- **`sub`**: Compute the element-wise subtraction of multiple lists.\r\n- **`scalarSub`**: Subtract a scalar value from each element of a list.\r\n- **`div`**: Compute the element-wise division of multiple lists.\r\n- **`scalarDiv`**: Divide each element of a list by a scalar value.\r\n- **`floorDiv`**: Compute the element-wise floor division of multiple lists.\r\n- **`scalarFloorDiv`**: Perform floor division of each element of a list by a scalar value.\r\n- **`modulo`**: Compute the element-wise modulo operation of multiple lists.\r\n- **`scalarModulo`**: Perform modulo operation on each element of a list with a scalar value.\r\n- **`pow`**: Compute the element-wise power of a list with a scalar value.\r\n- **`flatten`**: Flatten a nested list to a single list.\r\n\r\n## Vector Operations\r\n\r\nThe **`Vector`** class provides operations on 3-dimensional vectors:\r\n\r\n- **`add`**: Add multiple 3-dimensional vectors.\r\n- **`sub`**: Subtract multiple 3-dimensional vectors.\r\n- **`crossProduct`**: Compute the cross product of multiple 3-dimensional vectors.\r\n- **`dotProduct`**: Compute the dot product of multiple 3-dimensional vectors.\r\n- **`magnitude`**: Compute the magnitude of a 3-dimensional vector.\r\n- **`projection`**: Compute the projection of one 3-dimensional vector onto another.\r\n- **`angleOfProjection`**: Compute the angle of projection between two 3-dimensional vectors.\r\n\r\n## Matrix Operations\r\n\r\nThe **`Matrix`** class provides operations on matrices:\r\n\r\n- **`isMatrix`**: Check if a given nested list is a matrix.\r\n- **`isSquare`**: Check if a given matrix is square.\r\n- **`add`**: Add multiple matrices element-wise.\r\n- **`scalarAdd`**: Add a scalar value to each element of a matrix.\r\n- **`sub`**: Subtract multiple matrices element-wise.\r\n- **`scalarSub`**: Subtract a scalar value from each element of a matrix.\r\n- **`product`**: Multiply multiple matrices.\r\n- **`scalarProduct`**: Multiply each element of a matrix by a scalar value.\r\n- **`T`**: Transpose a matrix.\r\n- **`subMatrix`**: Extract a submatrix by removing a specific row and column from the original matrix.\r\n- **`det`**: Calculate the determinant of a square matrix.\r\n- **`cofactor`**: Calculate the cofactors of a square matrix.\r\n- **`adjoint`**: Calculate the adjoint (adjugate) of a square matrix.\r\n- **`inv`**: Calculate the inverse of a square matrix.\r\n- **`traces`**: Calculate the sum of the diagonal elements of a square matrix.\r\n- **`diagonalSum`**: Calculate the sum of the diagonal and anti-diagonal elements of a square matrix.\r\n- **`removeCol`**: Remove a specific column from a matrix.\r\n- **`removeRow`**: Remove a specific row from a matrix.\r\n- **`reciprocal`**: Calculate the reciprocal of each element in a matrix.\r\n\r\n## Set Operations\r\n\r\nThe **`Set`** class provides operations on sets:\r\n\r\n- **`toSet`**: Convert a list to a set, removing duplicates.\r\n- **`intersect`**: Compute the intersection of multiple sets.\r\n- **`union`**: Compute the union of multiple sets.\r\n- **`belongsTo`**: Check if an element belongs to a set.\r\n- **`subSet`**: Check if one set is a subset of another.\r\n\r\n## Mathematical Functions\r\n\r\nNumSpark includes various **mathematical** functions:\r\n\r\n- **`max`**: Find the maximum value in an array.\r\n- **`min`**: Find the minimum value in an array.\r\n- **`sin`**: Compute the sine of an angle (in radians or degrees).\r\n- **`cos`**: Compute the cosine of an angle (in radians or degrees).\r\n- **`tan`**: Compute the tangent of an angle (in radians or degrees).\r\n- **`cot`**: Compute the cotangent of an angle (in radians or degrees).\r\n- **`cosec`**: Compute the cosecant of an angle (in radians or degrees).\r\n- **`sec`**: Compute the secant of an angle (in radians or degrees).\r\n- **`asin`**: Compute the arcsine of an angle (in radians).\r\n- **`acos`**: Compute the arccosine of an angle (in radians).\r\n- **`atan`**: Compute the arctangent of an angle (in radians).\r\n- **`acot`**: Compute the arccotangent of an angle (in radians).\r\n- **`acosec`**: Compute the arccosecant of an angle (in radians).\r\n- **`asec`**: Compute the arcsecant of an angle (in radians).\r\n- **`sqrt`**: Compute the square root of a number.\r\n- **`cbrt`**: Compute the cube root of a number.\r\n- **`power`**: Compute the power of a number with a given exponent.\r\n- **`exp`**: Compute the exponential function of a number.\r\n- **`factorial`**: Compute the factorial of a number.\r\n- **`fibSequence`**: Generate a Fibonacci sequence up to a given number.\r\n- **`floor`**: Round a number down to the nearest integer.\r\n- **`ceil`**: Round a number up to the nearest integer.\r\n- **`quadratic_roots`**: Calculate the roots of a quadratic equation.\r\n- **`log`**: Compute the logarithm of a number (base 10).\r\n- **`ln`**: Compute the natural logarithm of a number (base e).\r\n- **`logn`**: Compute the logarithm of a number with a specified base.\r\n- **`permutation`**: Calculate the number of permutations of `n` objects taken `r` at a time.\r\n- **`combination`**: Calculate the number of combinations of `n` objects taken `r` at a time.\r\n- **`product`**: Compute the product of elements in an array.\r\n- **`summation`**: Compute the sum of elements in an array.\r\n- **`mean`**: Calculate the arithmetic mean (average) of an array.\r\n- **`median`**: Calculate the median of an array.\r\n- **`mode`**: Calculate the mode of an array.\r\n- **`variance`**: Calculate the variance of an array (sample or population).\r\n- **`standard_deviation`**: Calculate the standard deviation of an array (sample or population).\r\n- **`skewness`**: Calculate the skewness of an array.\r\n- **`kurtosis`**: Calculate the kurtosis of an array.\r\n- **`geometric_mean`**: Calculate the geometric mean of an array\r\n- **`harmonic_mean(array: list)`**: Calculates the harmonic mean of a list of numbers.\r\n- **`correlation_coefficient(x: list, y: list)`**: Computes the correlation coefficient between two lists of numbers.\r\n- **`slope_intercept(array1: list, array2: list)`**: Calculates the slope and intercept of the linear regression line for two arrays of data points.\r\n- **`moving_average(array: list, steps: int)`**: Computes the moving average of a list of numbers using a given window size.\r\n- **`exponential_moving_average(array: list, alpha: int|float)`**: Calculates the exponential moving average of a list of numbers using a smoothing factor `alpha`.\r\n- **`mean_sqrd_error(actual: list, predicted: list)`**: Computes the mean squared error between two lists of actual and predicted values.\r\n- **`root_mean_sqrd_error(actual: list, predicted: list)`**: Calculates the root mean squared error between two lists of actual and predicted values.\r\n- **`errors(actual: list, predicted: list)`**: Calculates the errors (differences) between two lists of actual and predicted values.\r\n- **`mean_error(actual: list, predicted: list)`**: Computes the mean error (average of errors) between two lists of actual and predicted values.\r\n- **`power(base: int|float, exponent: int|float)`**: Raises the base to the power of the exponent.\r\n- **`power_sum(array: list, exponent: int|float)`**: Computes the sum of the elements in the array raised to the power of the given exponent.\r\n- **`power_array(array: list, exponent: int|float)`**: Generates a new list with elements from the input list raised to the power of the given exponent.\r\n- **`primes(limit: int)`**: Generates a list of prime numbers up to a given limit.\r\n- **`isprime(number: int)`**: Checks if a given number is prime.\r\n- **`cost_function(actual: list, predicted: list)`**: Computes the cost function (mean squared error) between two lists of actual and predicted values for a regression problem.\r\n- **`scaling(array: list, feature_range: tuple = (0, 1))`**: Scales the values in the array to a specified feature range (default 0 to 1).\r\n- **`gaussian(array: list)`**: Generates a list of values representing the Gaussian distribution based on the input data.\r\n- **`sigmoid(x: int)`**: Computes the sigmoid function for a given input.\r\n- **`zscore(array: list, number: int) -> int|float`**: Calculates the z-score of a given number in relation to a list of data.\r\n- **`euclidean_distance(array1: list, array2: list)`**: Calculates the Euclidean distance between two lists of coordinates (2D).\r\n- **`manhattan_distance(array1: list, array2: list)`**: Computes the Manhattan distance between two lists of coordinates (2D).\r\n- **`camberra_distance(array1: list, array2: list)`**: Calculates the Canberra distance between two lists of coordinates (2D).\r\n- **`integrate(expression: str, wrt: str = \"x\")`**: Performs symbolic integration of a given expression with respect to the specified variable.\r\n- **`derivate(expression: str, wrt: str = \"x\")`**: Performs symbolic differentiation of a given expression with respect to the specified variable.\r\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "A math library for python",
    "version": "1.2",
    "project_urls": {
        "Bug Reports": "https://github.com/Sahil-Rajwar-2004/NumSpark/issues",
        "Homepage": "https://github.com/Sahil-Rajwar-2004/NumSpark",
        "Source": "https://github.com/Sahil-Rajwar-2004/NumSpark"
    },
    "split_keywords": [
        "math",
        "library",
        "numpy-alternative",
        "sci-calc",
        "calc"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b8072c2edae5730cc285248ee85948fc7a8a7037693b1e9aa525af3d43d07163",
                "md5": "f36ae5bd87b8a21f058036922503221a",
                "sha256": "717ff5b1be0602c1181c926d528b0d1ff4588daea9b2cccc446067add6192e6f"
            },
            "downloads": -1,
            "filename": "numspark-1.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f36ae5bd87b8a21f058036922503221a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 10197,
            "upload_time": "2023-08-07T20:30:13",
            "upload_time_iso_8601": "2023-08-07T20:30:13.275231Z",
            "url": "https://files.pythonhosted.org/packages/b8/07/2c2edae5730cc285248ee85948fc7a8a7037693b1e9aa525af3d43d07163/numspark-1.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "73e7cdf316ada0aa5f314118d041438234c0780c915e3971241a43fc8fe348ee",
                "md5": "718564091fcd932a01c6755fb1281ec6",
                "sha256": "22f248b24c230cd2a906ceb10b40ab7d60b2ba7d0da1e5a5967c8425ad97a642"
            },
            "downloads": -1,
            "filename": "numspark-1.2.tar.gz",
            "has_sig": false,
            "md5_digest": "718564091fcd932a01c6755fb1281ec6",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 12582,
            "upload_time": "2023-08-07T20:30:15",
            "upload_time_iso_8601": "2023-08-07T20:30:15.069577Z",
            "url": "https://files.pythonhosted.org/packages/73/e7/cdf316ada0aa5f314118d041438234c0780c915e3971241a43fc8fe348ee/numspark-1.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-08-07 20:30:15",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Sahil-Rajwar-2004",
    "github_project": "NumSpark",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "numspark"
}
        
Elapsed time: 2.19458s