{"id":21815353,"url":"https://github.com/xames3/xsnumpy","last_synced_at":"2026-05-15T22:37:01.831Z","repository":{"id":264876392,"uuid":"890676441","full_name":"xames3/xsnumpy","owner":"xames3","description":"Basic and bare-bones functionality of NumPy just using pure Python.","archived":false,"fork":false,"pushed_at":"2025-02-03T00:06:46.000Z","size":276,"stargazers_count":0,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-29T05:40:28.478Z","etag":null,"topics":["numpy","numpy-arrays","numpy-library","python"],"latest_commit_sha":null,"homepage":"https://smart.mes3.dev/projects/xsnumpy.html#what-can-xsnumpy-do","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xames3.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-11-19T01:37:43.000Z","updated_at":"2025-09-05T05:34:51.000Z","dependencies_parsed_at":"2024-11-26T15:57:37.229Z","dependency_job_id":"19f8464c-0d2e-4819-8a9d-afbb65484f96","html_url":"https://github.com/xames3/xsnumpy","commit_stats":null,"previous_names":["xames3/xsnumpy"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/xames3/xsnumpy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xames3%2Fxsnumpy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xames3%2Fxsnumpy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xames3%2Fxsnumpy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xames3%2Fxsnumpy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xames3","download_url":"https://codeload.github.com/xames3/xsnumpy/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xames3%2Fxsnumpy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33082114,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-15T20:25:35.270Z","status":"ssl_error","status_checked_at":"2026-05-15T20:25:34.732Z","response_time":103,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["numpy","numpy-arrays","numpy-library","python"],"created_at":"2024-11-27T15:18:16.708Z","updated_at":"2026-05-15T22:37:01.800Z","avatar_url":"https://github.com/xames3.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":".. Author: Akshay Mestry \u003cxa@mes3.dev\u003e\n.. Created on: Monday, November 18 2024\n.. Last updated on: Friday, January 24 2025\n\n===============================================================================\nxsNumPy\n===============================================================================\n\nEtymology: *xs* (eXtra Small) and *numpy* (NumPy)\n\n**xsNumPy** is personal pet-project of mine where I tried and implemented the\nbasic and bare-bones functionality of `NumPy`_ just using pure Python. This\nproject is a testament to the richness of NumPy's design. By reimplementing\nits core features in a self-contained and minimalistic fashion, this project\naims to:\n\n- Provide an educational tool for those seeking to understand array mechanics.\n- Serve as a lightweight alternative for environments where dependencies\n  must be minimized.\n- Encourage developers to explore the intricacies of multidimensional\n  array computation.\n\nThis project acknowledges the incredible contributions of the NumPy team and\ncommunity over decades of development. While this module reimagines NumPy's\nfunctionality, it owes its design, inspiration, and motivation to the\npioneering work of the NumPy developers. This module is not a replacement for\nNumPy but an homage to its brilliance and an opportunity to explore its\nconcepts from the ground up.\n\n**xsNumPy** is a lightweight, pure-Python library inspired by NumPy, designed\nto mimic essential array operations and features. This project is ideal for\nlearning and experimentation with multidimensional array processing and\nnumerical computing concepts.\n\n-------------------------------------------------------------------------------\nInstallation\n-------------------------------------------------------------------------------\n\n.. See more at: https://stackoverflow.com/a/15268990\n\nInstall the latest version of xsNumPy using `pip`_:\n\n.. code-block:: bash\n\n    pip install -U git+https://github.com/xames3/xsnumpy.git#egg=xsnumpy\n\n-------------------------------------------------------------------------------\nFeatures\n-------------------------------------------------------------------------------\n\nAs of now, **xsNumPy** offers the following features:\n\nN-dimensional array (ndarray)\n===============================================================================\n\n- **xsnumpy.ndarray.** The central data structure representing N-dimensional\n  arrays with support for:\n\n  - Arbitrary shapes and data types.\n  - Broadcasting for compatible operations.\n  - Arithmetic and comparison operations.\n\n.. code-block:: python\n\n    \u003e\u003e\u003e import xsnumpy as xp\n    \u003e\u003e\u003e\n    \u003e\u003e\u003e a = xp.array([[1, 0], [0, 1]])\n    \u003e\u003e\u003e b = xp.array([[4, 1], [2, 2]])\n    \u003e\u003e\u003e\n    \u003e\u003e\u003e a + b\n    array([[5, 1], \n           [2, 3]])\n    \u003e\u003e\u003e a - b\n    array([[-3, -1], \n           [-2, -1]])\n    \u003e\u003e\u003e a * b\n    array([[4, 0], \n           [0, 2]])\n    \u003e\u003e\u003e a / b\n    array([[0.25, 0.  ], \n           [0.  ,  0.5]])\n    \u003e\u003e\u003e a // b\n    array([[0, 0], \n           [0, 0]])\n    \u003e\u003e\u003e a ** b\n    array([[1, 0], \n           [0, 1]])\n    \u003e\u003e\u003e a % b\n    array([[1, 0], \n           [0, 1]])\n    \u003e\u003e\u003e a @ b\n    array([[4, 1], \n           [2, 2]])\n    \u003e\u003e\u003e a \u003c b\n    array([[True, True], \n           [True, True]])\n    \u003e\u003e\u003e a \u003e= b\n    array([[False, False], \n           [False, False]])\n\nArray creation routines\n===============================================================================\n\n- **xsnumpy.array.** Create an N-dimensional array.\n\n.. code-block:: python\n\n    \u003e\u003e\u003e xp.array([[1, 2, 3], [4, 5, 6]])\n    array([[1, 2, 3], \n           [4, 5, 6]])\n    \u003e\u003e\u003e xp.array([1, 2, 3.0])\n    array([1. , 2. , 3. ])\n    \u003e\u003e\u003e xp.array([1, 0, 2], dtype=xp.bool)\n    array([True, False, True])\n\n- **xsnumpy.empty.** Create an uninitialized array of the given shape.\n\n.. code-block:: python\n\n    \u003e\u003e\u003e xp.empty([2, 2])\n    array([[0. , 0. ], \n           [0. , 0. ]])\n    \u003e\u003e\u003e xp.empty([2, 2], dtype=xp.int32)\n    array([[0, 0], \n           [0, 0]])\n\n- **xsnumpy.zeros.** Create an array filled with zeros.\n\n.. code-block:: python\n\n    \u003e\u003e\u003e xp.zeros((2, 1))\n    array([[0. ], \n           [0. ]])\n    \u003e\u003e\u003e xp.zeros((5,))\n    array([0. , 0. , 0. , 0. , 0. ])\n    \u003e\u003e\u003e xp.zeros((5,), dtype=xp.int32)\n    array([0, 0, 0, 0, 0])\n\n- **xsnumpy.ones.** Create an array filled with ones.\n\n.. code-block:: python\n\n    \u003e\u003e\u003e xp.ones((2, 1))\n    array([[1. ], \n           [1. ]])\n    \u003e\u003e\u003e xp.ones((5,))\n    array([1. , 1. , 1. , 1. , 1. ])\n\n- **xsnumpy.full.** Create an array filled with *fill_value*.\n\n.. code-block:: python\n\n    \u003e\u003e\u003e xp.full((2, 2), 10)\n    array([[10. , 10. ], \n           [10. , 10. ]])\n\n- **xsnumpy.arange.** Generate evenly spaced values within a given range.\n\n.. code-block:: python\n\n    \u003e\u003e\u003e xp.arange(3)\n    array([0, 1, 2])\n    \u003e\u003e\u003e xp.arange(3.0)\n    array([0. , 1. , 2. ])\n    \u003e\u003e\u003e xp.arange(3, 7)\n    array([3, 4, 5, 6])\n    \u003e\u003e\u003e xp.arange(3, 7, 2)\n    array([3, 5])\n    \u003e\u003e\u003e xp.arange(0, 5, 0.5)\n    array([0. , 0.5, 1. , 1.5, 2. , 2.5, 3. , 3.5, 4. , 4.5])\n\n- **xsnumpy.eye.** Create a 2D array with ones on the diagonal and zeros\n  elsewhere.\n\n.. code-block:: python\n\n    \u003e\u003e\u003e xp.eye(2, dtype=xp.int32)\n    array([[1, 0], \n           [0, 1]])\n\n- **xsnumpy.identity.** Create an identity matrix or 2D array with ones on the\n  main diagonal.\n\n.. code-block:: python\n\n    \u003e\u003e\u003e xp.identity(3)\n    array([[1. , 0. , 0. ], \n           [0. , 1. , 0. ], \n           [0. , 0. , 1. ]])\n\n- **xsnumpy.tri.** Generate a lower triangular matrix filled with ones.\n\n.. code-block:: python\n\n    \u003e\u003e\u003e xp.tri(3, 5, 2)\n    array([[0. , 0. , 1. , 0. , 0. ], \n           [0. , 0. , 0. , 1. , 0. ], \n           [0. , 0. , 0. , 0. , 1. ]])\n    \u003e\u003e\u003e xp.tri(3, 5, -1, dtype=xp.int32)\n    array([[0, 0, 0, 0, 0], \n           [1, 0, 0, 0, 0], \n           [0, 1, 0, 0, 0]])\n\n- **xsnumpy.diag.** Extract a diagonal or construct a diagonal array.\n\n.. code-block:: python\n\n    \u003e\u003e\u003e a = xp.arange(9).reshape((3, 3))\n    \u003e\u003e\u003e a\n    array([[0, 1, 2], \n        [3, 4, 5], \n        [6, 7, 8]])\n    \u003e\u003e\u003e xp.diag(a)\n    array([0, 4, 8])\n    \u003e\u003e\u003e xp.diag(a, k=1)\n    array([1, 5])\n\nArray attributes\n===============================================================================\n\n- **ndarray.shape.** Tuple of array dimensions.\n\n.. code-block:: python\n\n    \u003e\u003e\u003e x = xp.array([1, 2, 3, 4])\n    \u003e\u003e\u003e x.shape\n    (4,)\n    \u003e\u003e\u003e y = xp.zeros((2, 3, 4))\n    \u003e\u003e\u003e y.shape\n    (2, 3, 4)\n    \u003e\u003e\u003e y.shape = (3, 8)\n    \u003e\u003e\u003e y\n    array([[0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. ], \n           [0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. ], \n           [0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. ]])\n\n- **ndarray.strides.** Tuple of bytes to step in each dimension when traversing\n  an array.\n\n.. code-block:: python\n\n    \u003e\u003e\u003e y = xp.ones((2, 7))\n    \u003e\u003e\u003e y\n    array([[1. , 1. , 1. , 1. , 1. , 1. , 1. ], \n           [1. , 1. , 1. , 1. , 1. , 1. , 1. ]])\n    \u003e\u003e\u003e y.strides\n    (28, 4)\n\n- **ndarray.ndim.** Number of array dimensions.\n\n.. code-block:: python\n\n    \u003e\u003e\u003e x = xp.array([1, 2, 3])\n    \u003e\u003e\u003e x.ndim\n    1\n    \u003e\u003e\u003e y = xp.zeros((2, 3, 4))\n    \u003e\u003e\u003e y.ndim\n    3\n\n- **ndarray.data.** Python buffer object pointing to the start of the array's\n  data.\n\n- **ndarray.size.** Number of elements in the array.\n\n.. code-block:: python\n\n    \u003e\u003e\u003e x = xp.zeros((3, 5, 2))\n    \u003e\u003e\u003e x.size\n    30\n\n- **ndarray.itemsize.** Length of one array element in bytes.\n\n.. code-block:: python\n\n    \u003e\u003e\u003e x = xp.array([1, 2, 3], dtype=xp.float64)\n    \u003e\u003e\u003e x.itemsize\n    8\n    \u003e\u003e\u003e x = xp.array([1, 2, 3], dtype=xp.int16)\n    \u003e\u003e\u003e x.itemsize\n    2\n\n- **ndarray.nbytes.** Total bytes consumed by the elements of the array.\n\n.. code-block:: python\n\n    \u003e\u003e\u003e x = xp.zeros((3, 5, 2), dtype=xp.float32)\n    \u003e\u003e\u003e x.nbytes\n    120\n\n- **ndarray.base.** Base object if memory is from some other object.\n\n.. code-block:: python\n\n    \u003e\u003e\u003e x = xp.array([1, 2, 3, 4])\n    \u003e\u003e\u003e x.base is None\n    True\n    \u003e\u003e\u003e y = x[2:]\n    \u003e\u003e\u003e y.base is x\n    True\n\n- **ndarray.dtype.** Data-type of the array's elements.\n\n.. code-block:: python\n\n    \u003e\u003e\u003e x = xp.array([1, 2, 3, 4])\n    \u003e\u003e\u003e x.dtype\n    dtype('int32')\n    \u003e\u003e\u003e type(x.dtype)\n    \u003cclass 'xsnumpy.dtype'\u003e\n\n- **ndarray.T.** View of the transposed array.\n\n.. code-block:: python\n\n    \u003e\u003e\u003e a = xp.array([[1, 2], [3, 4]])\n    \u003e\u003e\u003e a\n    array([[1, 2], \n           [3, 4]])\n    \u003e\u003e\u003e a.T\n    array([[1, 3], \n           [2, 4]])\n\nArray methods\n===============================================================================\n\n- **ndarray.all().** Returns True if all elements evaluate to True.\n\n.. code-block:: python\n\n    \u003e\u003e\u003e x = xp.array([[True, False], [True, True]])\n    \u003e\u003e\u003e x.all()\n    False\n    \u003e\u003e\u003e x.all(axis=0)\n    array([ True, False])\n    \u003e\u003e\u003e x = xp.array([-1, 4, 5])\n    \u003e\u003e\u003e x.all()\n    True\n\n- **ndarray.any().** Test whether any array element along a given axis\n  evaluates to True.\n\n.. code-block:: python\n\n    \u003e\u003e\u003e x = xp.array([[True, False], [True, True]])\n    \u003e\u003e\u003e x.any()\n    True\n    \u003e\u003e\u003e x = xp.array([[True, False, True ], [False, False, False]])\n    \u003e\u003e\u003e x.any(axis=0)\n    array([ True, False,  True])\n    \u003e\u003e\u003e a = xp.array([[1, 0, 0], [0, 0, 1], [0, 0, 0]])\n    \u003e\u003e\u003e a.any(axis=0)\n    array([ True, False,  True])\n\n- **ndarray.astype().** Copies an array to a specified data type.\n\n.. code-block:: python\n\n    \u003e\u003e\u003e arr = xp.array([1, 2, 3])\n    \u003e\u003e\u003e arr.astype(xp.float64)\n    array([1. , 2. , 3. ], dtype=float64)\n\n- **ndarray.fill().** Fill the array with a scalar value.\n\n.. code-block:: python\n\n    \u003e\u003e\u003e a = xp.array([1, 2])\n    \u003e\u003e\u003e a.fill(0)\n    \u003e\u003e\u003e a\n    array([0, 0])\n\n- **ndarray.flatten().** Return a copy of the array collapsed into one\n  dimension.\n\n.. code-block:: python\n\n    \u003e\u003e\u003e a = xp.array([[1, 2], [3, 4]])\n    \u003e\u003e\u003e a.flatten()\n    array([1, 2, 3, 4])\n\n- **ndarray.item().** Copy an element of an array to a standard Python scalar\n  and return it.\n\n.. code-block:: python\n\n    \u003e\u003e\u003e x = xp.array([[2, 2, 6], [1, 3, 6], [1, 0, 1]])\n    \u003e\u003e\u003e x.item(3)\n    1\n    \u003e\u003e\u003e x.item(7)\n    0\n    \u003e\u003e\u003e x.item((0, 1))\n    2\n    \u003e\u003e\u003e x.item((2, 2))\n    1\n\n- **ndarray.item().** Copy an element of an array to a standard Python scalar\n  and return it.\n\n.. code-block:: python\n\n    \u003e\u003e\u003e x = xp.array([[2, 2, 6], [1, 3, 6], [1, 0, 1]])\n    \u003e\u003e\u003e x.item(3)\n    1\n    \u003e\u003e\u003e x.item(7)\n    0\n    \u003e\u003e\u003e x.item((0, 1))\n    2\n    \u003e\u003e\u003e x.item((2, 2))\n    1\n\n- **ndarray.min().** Return the minimum along a given axis.\n\n.. code-block:: python\n\n    \u003e\u003e\u003e x = xp.array([[0, 1], [2, 3]])\n    \u003e\u003e\u003e x.min()\n    0\n    \u003e\u003e\u003e x.min(axis=0)\n    array([0, 1])\n    \u003e\u003e\u003e x.min(axis=1)\n    array([0, 2])\n\n- **ndarray.max().** Return the maximum along a given axis.\n\n.. code-block:: python\n\n    \u003e\u003e\u003e x = xp.array([[0, 1], [2, 3]])\n    \u003e\u003e\u003e x.max()\n    3\n    \u003e\u003e\u003e x.max(axis=0)\n    array([2, 3])\n    \u003e\u003e\u003e x.max(axis=1)\n    array([1, 3])\n\n- **ndarray.sum().** Sum of array elements over a given axis.\n\n.. code-block:: python\n\n    \u003e\u003e\u003e a = xp.array([0.5, 1.5])\n    \u003e\u003e\u003e a.sum()\n    2.0\n    \u003e\u003e\u003e a = xp.array([[0, 1], [0, 5]])\n    \u003e\u003e\u003e a.sum()\n    6\n    \u003e\u003e\u003e a.sum(axis=0)\n    array([0, 6])\n    \u003e\u003e\u003e a.sum(axis=1)\n    array([1, 5])\n\n- **ndarray.prod().** Return the product of array elements over a given axis.\n\n.. code-block:: python\n\n    \u003e\u003e\u003e a = xp.array([1., 2.])\n    \u003e\u003e\u003e a.prod()\n    2.0\n    \u003e\u003e\u003e a = xp.array([[1., 2.], [3., 4.]])\n    \u003e\u003e\u003e a.prod()\n    24.0\n    \u003e\u003e\u003e a.prod(axis=1)\n    array([2.  , 12. ])\n    \u003e\u003e\u003e a.prod(axis=0)\n    array([3. , 8. ])\n\n- **ndarray.reshape().** Gives a new shape to an array without changing its\n  data.\n\n.. code-block:: python\n\n    \u003e\u003e\u003e a = xp.arange(6).reshape((3, 2))\n    \u003e\u003e\u003e a\n    array([[0, 1], \n           [2, 3], \n           [4, 5]])\n    \u003e\u003e\u003e a = xp.array([[1, 2, 3], [4, 5, 6]])\n    \u003e\u003e\u003e a.reshape((6,))\n    array([1, 2, 3, 4, 5, 6])\n\n- **ndarray.transpose().** Returns an array with axes transposed.\n\n.. code-block:: python\n\n    \u003e\u003e\u003e a = xp.array([[1, 2], [3, 4]])\n    \u003e\u003e\u003e a\n    array([[1, 2], \n           [3, 4]])\n    \u003e\u003e\u003e a.transpose()\n    array([[1, 3], \n           [2, 4]])\n    \u003e\u003e\u003e a = xp.array([1, 2, 3, 4])\n    \u003e\u003e\u003e a.transpose()\n    array([1, 2, 3, 4])\n    \u003e\u003e\u003e a = xp.ones((1, 2, 3))\n    \u003e\u003e\u003e a.transpose((1, 0, 2)).shape\n    (2, 1, 3)\n\nConstants\n===============================================================================\n\n- **xsnumpy.e.** Euler's constant.\n\n.. code-block:: python\n\n    \u003e\u003e\u003e xp.e\n    2.718281828459045\n\n- **xsnumpy.inf.** IEEE 754 floating point representation of (positive)\n  infinity.\n\n.. code-block:: python\n\n    \u003e\u003e\u003e xp.inf\n    inf\n\n- **xsnumpy.nan.** IEEE 754 floating point representation of Not a Number\n  (NaN).\n\n.. code-block:: python\n\n    \u003e\u003e\u003e xp.nan\n    nan\n\n- **xsnumpy.newaxis.** A convenient alias for None, useful for indexing arrays.\n\n.. code-block:: python\n\n    \u003e\u003e\u003e xp.newaxis is None\n    True\n\n- **xsnumpy.pi.** Pi...\n\n.. code-block:: python\n\n    \u003e\u003e\u003e xp.pi\n    3.141592653589793\n\nLinear algebra\n===============================================================================\n\n- **xsnumpy.dot.** Dot product of two arrays.\n\n.. code-block:: python\n\n    \u003e\u003e\u003e xp.dot(3, 4)\n    12\n    \u003e\u003e\u003e a = xp.array([[1, 0], [0, 1]])\n    \u003e\u003e\u003e b = xp.array([[4, 1], [2, 2]])\n    \u003e\u003e\u003e xp.dot(a, b)\n    array([[4, 1], \n           [2, 2]])\n\n- **xsnumpy.matmul.** Matrix multiplication product of two arrays.\n\n.. code-block:: python\n\n    \u003e\u003e\u003e a = xp.array([[1, 0], [0, 1]])\n    \u003e\u003e\u003e b = xp.array([[4, 1], [2, 2]])\n    \u003e\u003e\u003e xp.matmul(a, b)\n    array([[4, 1], \n           [2, 2]])\n\n- **xsnumpy.add.** Add arguments element-wise.\n\n.. code-block:: python\n\n    \u003e\u003e\u003e xp.add(3, 4)\n    7\n    \u003e\u003e\u003e a = xp.array([[1, 0], [0, 1]])\n    \u003e\u003e\u003e b = xp.array([[4, 1], [2, 2]])\n    \u003e\u003e\u003e xp.add(a, b)\n    array([[5. , 1. ], \n           [2. , 3. ]])\n\n- **xsnumpy.subtract.** Subtract arguments element-wise.\n\n.. code-block:: python\n\n    \u003e\u003e\u003e xp.subtract(3, 4)\n    -1\n    \u003e\u003e\u003e a = xp.array([[1, 0], [0, 1]])\n    \u003e\u003e\u003e b = xp.array([[4, 1], [2, 2]])\n    \u003e\u003e\u003e xp.subtract(a, b)\n    array([[-3. , -1. ], \n           [-2. , -1. ]])\n\n- **xsnumpy.multiply.** Multiply arguments element-wise.\n\n.. code-block:: python\n\n    \u003e\u003e\u003e xp.multiply(3, 4)\n    12\n    \u003e\u003e\u003e a = xp.array([[1, 0], [0, 1]])\n    \u003e\u003e\u003e b = xp.array([[4, 1], [2, 2]])\n    \u003e\u003e\u003e xp.multiply(a, b)\n    array([[4. , 0. ], \n           [0. , 2. ]])\n\n- **xsnumpy.divide.** Divide arguments element-wise.\n\n.. code-block:: python\n\n    \u003e\u003e\u003e xp.divide(4, 4)\n    1.0\n    \u003e\u003e\u003e a = xp.array([[1, 0], [0, 1]])\n    \u003e\u003e\u003e b = xp.array([[4, 1], [2, 2]])\n    \u003e\u003e\u003e xp.divide(a, b)\n    array([[0.25, 0.  ], \n           [0.  ,  0.5]])\n\n- **xsnumpy.power.** First array elements raised to powers from second array,\n  element-wise.\n\n.. code-block:: python\n\n    \u003e\u003e\u003e xp.power(3, 4)\n    81\n    \u003e\u003e\u003e a = xp.array([[1, 0], [0, 1]])\n    \u003e\u003e\u003e b = xp.array([[4, 1], [2, 2]])\n    \u003e\u003e\u003e xp.power(a, b)\n    array([[1. , 0. ], \n           [0. , 1. ]])\n\nRandom Sampling and Miscellaneous\n===============================================================================\n\n- **xsnumpy.set_printoptions.** Set printing precision for decimal values.\n\n.. code-block:: python\n\n    \u003e\u003e\u003e xp.set_printoptions(precision=4)\n\n- **xsnumpy.random.default_rng.** Construct a new Generator with the default\n  BitGenerator (PCG64).\n\n.. code-block:: python\n\n    \u003e\u003e\u003e rng = xp.random.default_rng(12345)\n    \u003e\u003e\u003e print(rng)\n    Generator(PCG64)\n    \u003e\u003e\u003e rfloat = rng.random()\n    \u003e\u003e\u003e rfloat\n    0.41661987254534116\n    \u003e\u003e\u003e type(rfloat)\n    \u003cclass 'float'\u003e\n    \u003e\u003e\u003e rints = rng.integers(low=0, high=10, size=3)\n    \u003e\u003e\u003e rints\n    array([0, 4, 5])\n    \u003e\u003e\u003e type(rints[0])\n    \u003cclass 'int'\u003e\n    \u003e\u003e\u003e arr1 = rng.random((3, 3))\n    \u003e\u003e\u003e arr1\n    array([[ 0.9317, 0.2702, 0.43622], \n           [ 0.3730, 0.8741, 0.26109], \n           [ 0.6272, 0.6117, 0.18680]])\n\n-------------------------------------------------------------------------------\nUsage and Documentation\n-------------------------------------------------------------------------------\n\nThe codebase is structured to be intuitive and mirrors the design principles\nof NumPy to a significant extent. Comprehensive docstrings are provided for\neach module and function, ensuring clarity and ease of understanding. Users\nare encouraged to delve into the code, experiment with it, and modify it to\nsuit their learning curve.\n\nSince, the implementation doesn't rely on any external packages, it will work\nwith any CPython build v3.10 and higher. Technically, it should work on 3.9 and\nbelow as well but due to some syntactical and type-aliasing changes, it will\nnot support it directly. For instance, the typing module was significantly\nchanged in 3.10, hence some features like ``types.GenericAlias`` and using\nnative types like ``tuple``, ``list``, etc. will not work. If you choose to\nremove all the typing stuff, the code will work just fine, at least that's what\nI hope.\n\n**Note.** xsNumPy cannot and should not be used as an alternative to NumPy.\n|ss| Another important note is the fact, this implementation doesn't fully\nsupport array-broadcasting which is possibly one of the most important facet\nof NumPy. Although, the existing features work with arrays when either their\nshapes match or one of the array has ``n.dim`` is less than the other array.\n\\ |se|\\\n\n**Update.** Broadcasting is now supported!\n\n-------------------------------------------------------------------------------\nContributions and Feedback\n-------------------------------------------------------------------------------\n\nContributions to this project are warmly welcomed. Whether it's refining the\ncode, enhancing the documentation, or extending the current feature set, your\ninput is highly valued. Feedback, whether constructive criticism or \ncommendation, is equally appreciated and will be instrumental in the evolution\nof this educational tool.\n\n-------------------------------------------------------------------------------\nAcknowledgments\n-------------------------------------------------------------------------------\n\nThis project is inspired by the remarkable work done by the `NumPy\nDevelopment Team`_. It is a tribute to their contributions to the field of\nmachine learning and the open-source community at large.\n\n-------------------------------------------------------------------------------\nLicense\n-------------------------------------------------------------------------------\n\nxsNumPy is licensed under the MIT License. See the `LICENSE`_ file for more\ndetails.\n\n.. _LICENSE: https://github.com/xames3/xsnumpy/blob/main/LICENSE\n.. _NumPy Development Team: https://numpy.org/doc/stable/dev/index.html\n.. _NumPy: https://numpy.org\n.. _pip: https://pip.pypa.io/en/stable/getting-started/\n\n.. |ss| raw:: html\n\n    \u003cstrike\u003e\n\n.. |se| raw:: html\n\n    \u003c/strike\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxames3%2Fxsnumpy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxames3%2Fxsnumpy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxames3%2Fxsnumpy/lists"}