diff --git a/docs/_toc.yml b/docs/_toc.yml index 574cad1..42328b4 100644 --- a/docs/_toc.yml +++ b/docs/_toc.yml @@ -22,7 +22,9 @@ parts: - file: python/python_fundamentals/modules_packages - caption: NumPy chapters: - - file: numpy/numpy + - file: numpy/intro_to_numpy + - file: numpy/numpy_quickstart + - file: numpy/numpy_fundamentals - caption: Pandas chapters: - file: pandas/pandas diff --git a/docs/numpy/intro_to_numpy.md b/docs/numpy/intro_to_numpy.md new file mode 100644 index 0000000..56b5acd --- /dev/null +++ b/docs/numpy/intro_to_numpy.md @@ -0,0 +1,22 @@ +# Introduction to NumPy + +## Apa itu NumPy? + +NumPy adalah library fundamental untuk scientific computing di Python. NumPy digunakan untuk melakukan operasi matematika pada multi-dimensional array object, beserta objek turunannya seperti masked arrays dan matrix. + +NumPy menyediakan fungsi-fungsi yang efisien untuk operasi matematika pada array, seperti operasi linear algebra, operasi statistik, shape manimpulation, sorting, selecting, I/O, dan lainnya. + +Core dari Numpy adalah objek `ndarray` yang mengenkapsulasi array n-dimensi dengan elemen-elemen yang seragam, dimana operasi-operasinya dilakukan pada kode yang telah tekompilasi. + +Referensi: https://numpy.org/doc/stable/user/whatisnumpy.html#what-is-numpy + +## Mengapa menggunakan NumPy? + +Python memiliki built-in `list` yang dapat digunakan untuk menyimpan data dalam bentuk array. Namun, `list` tidak efisien untuk melakukan operasi matematika pada data yang besar dan lambat untuk diproses. + +Berikut beberapa perbedaan antara Numpy array dengan Python list: + +1. Numpy array memiliki ukuran yang tetap, sedangkan Python list memiliki ukuran yang dinamis. Perubahan pada ukuran Numpy array akan menghasilkan array baru dan menghapus array lama. +2. Numpy array memiliki elemen-elemen yang seragam, sehingga ukuran mereka di dalam memori akan tetap sama. +3. Numpy array mendukung operasi matematika pada array ukuran besar secara efisien, sedangkan Python list tidak. +4. Bertambah banyaknya library scientific computing di Python yang menggunakan NumPy sebagai basisnya. diff --git a/docs/numpy/numpy.md b/docs/numpy/numpy.md deleted file mode 100644 index 7136bb0..0000000 --- a/docs/numpy/numpy.md +++ /dev/null @@ -1 +0,0 @@ -# NumPy diff --git a/docs/numpy/numpy_fundamentals.md b/docs/numpy/numpy_fundamentals.md new file mode 100644 index 0000000..998d773 --- /dev/null +++ b/docs/numpy/numpy_fundamentals.md @@ -0,0 +1,13 @@ +# NumPy Fundamentals + +Dokumen-dokumen dari situs resmi NumPy di bawah ini akan membantu kamu untuk lebih memahami konsep, design decisions, dan technical constrains dari NumPy. + +- [Array creation](https://numpy.org/doc/stable/user/basics.creation.html) +- [Indexing on ndarrays](https://numpy.org/doc/stable/user/basics.indexing.html) +- [I/O with NumPy](https://numpy.org/doc/stable/user/basics.io.html) +- [Data types](https://numpy.org/doc/stable/user/basics.types.html) +- [Broadcasting](https://numpy.org/doc/stable/user/basics.broadcasting.html) +- [Copies and views](https://numpy.org/doc/stable/user/basics.copies.html) +- [Working with Arrays of Strings And Bytes](https://numpy.org/doc/stable/user/basics.strings.html) +- [Structured arrays](https://numpy.org/doc/stable/user/basics.rec.html) +- [Universal functions (ufunc) basics](https://numpy.org/doc/stable/user/basics.ufuncs.html) diff --git a/docs/numpy/numpy_quickstart.md b/docs/numpy/numpy_quickstart.md new file mode 100644 index 0000000..20a423c --- /dev/null +++ b/docs/numpy/numpy_quickstart.md @@ -0,0 +1,11 @@ +# NumPy Quickstart + +Untuk mulai menggunakan NumPy dan mempelajari konsep dasar NumPy, kamu dapat membaca tutorial dari halaman resmi NumPy: + +[NumPy quickstart](https://numpy.org/doc/stable/user/quickstart.html) + +Tutorial di atas akan membantu kamu memahami tentang: + +1. Perbedaan antara one-, two-, dan n-dimensional arrays di NumPy +2. Bagaimana cara menggunakan operasi-operasi aljabar linear untuk n-dimensional arrays tanpa menggunakan for-loops +3. Memaham properti `axis` dan `shape` dari n-dimensional arrays diff --git a/poetry.lock b/poetry.lock index 1ce8227..30db2ba 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1606,6 +1606,60 @@ jupyter-server = ">=1.8,<3" [package.extras] test = ["pytest", "pytest-console-scripts", "pytest-jupyter", "pytest-tornasync"] +[[package]] +name = "numpy" +version = "2.0.1" +description = "Fundamental package for array computing in Python" +optional = false +python-versions = ">=3.9" +files = [ + {file = "numpy-2.0.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:0fbb536eac80e27a2793ffd787895242b7f18ef792563d742c2d673bfcb75134"}, + {file = "numpy-2.0.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:69ff563d43c69b1baba77af455dd0a839df8d25e8590e79c90fcbe1499ebde42"}, + {file = "numpy-2.0.1-cp310-cp310-macosx_14_0_arm64.whl", hash = "sha256:1b902ce0e0a5bb7704556a217c4f63a7974f8f43e090aff03fcf262e0b135e02"}, + {file = "numpy-2.0.1-cp310-cp310-macosx_14_0_x86_64.whl", hash = "sha256:f1659887361a7151f89e79b276ed8dff3d75877df906328f14d8bb40bb4f5101"}, + {file = "numpy-2.0.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4658c398d65d1b25e1760de3157011a80375da861709abd7cef3bad65d6543f9"}, + {file = "numpy-2.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4127d4303b9ac9f94ca0441138acead39928938660ca58329fe156f84b9f3015"}, + {file = "numpy-2.0.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:e5eeca8067ad04bc8a2a8731183d51d7cbaac66d86085d5f4766ee6bf19c7f87"}, + {file = "numpy-2.0.1-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:9adbd9bb520c866e1bfd7e10e1880a1f7749f1f6e5017686a5fbb9b72cf69f82"}, + {file = "numpy-2.0.1-cp310-cp310-win32.whl", hash = "sha256:7b9853803278db3bdcc6cd5beca37815b133e9e77ff3d4733c247414e78eb8d1"}, + {file = "numpy-2.0.1-cp310-cp310-win_amd64.whl", hash = "sha256:81b0893a39bc5b865b8bf89e9ad7807e16717f19868e9d234bdaf9b1f1393868"}, + {file = "numpy-2.0.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:75b4e316c5902d8163ef9d423b1c3f2f6252226d1aa5cd8a0a03a7d01ffc6268"}, + {file = "numpy-2.0.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:6e4eeb6eb2fced786e32e6d8df9e755ce5be920d17f7ce00bc38fcde8ccdbf9e"}, + {file = "numpy-2.0.1-cp311-cp311-macosx_14_0_arm64.whl", hash = "sha256:a1e01dcaab205fbece13c1410253a9eea1b1c9b61d237b6fa59bcc46e8e89343"}, + {file = "numpy-2.0.1-cp311-cp311-macosx_14_0_x86_64.whl", hash = "sha256:a8fc2de81ad835d999113ddf87d1ea2b0f4704cbd947c948d2f5513deafe5a7b"}, + {file = "numpy-2.0.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5a3d94942c331dd4e0e1147f7a8699a4aa47dffc11bf8a1523c12af8b2e91bbe"}, + {file = "numpy-2.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:15eb4eca47d36ec3f78cde0a3a2ee24cf05ca7396ef808dda2c0ddad7c2bde67"}, + {file = "numpy-2.0.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:b83e16a5511d1b1f8a88cbabb1a6f6a499f82c062a4251892d9ad5d609863fb7"}, + {file = "numpy-2.0.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:1f87fec1f9bc1efd23f4227becff04bd0e979e23ca50cc92ec88b38489db3b55"}, + {file = "numpy-2.0.1-cp311-cp311-win32.whl", hash = "sha256:36d3a9405fd7c511804dc56fc32974fa5533bdeb3cd1604d6b8ff1d292b819c4"}, + {file = "numpy-2.0.1-cp311-cp311-win_amd64.whl", hash = "sha256:08458fbf403bff5e2b45f08eda195d4b0c9b35682311da5a5a0a0925b11b9bd8"}, + {file = "numpy-2.0.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:6bf4e6f4a2a2e26655717a1983ef6324f2664d7011f6ef7482e8c0b3d51e82ac"}, + {file = "numpy-2.0.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:7d6fddc5fe258d3328cd8e3d7d3e02234c5d70e01ebe377a6ab92adb14039cb4"}, + {file = "numpy-2.0.1-cp312-cp312-macosx_14_0_arm64.whl", hash = "sha256:5daab361be6ddeb299a918a7c0864fa8618af66019138263247af405018b04e1"}, + {file = "numpy-2.0.1-cp312-cp312-macosx_14_0_x86_64.whl", hash = "sha256:ea2326a4dca88e4a274ba3a4405eb6c6467d3ffbd8c7d38632502eaae3820587"}, + {file = "numpy-2.0.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:529af13c5f4b7a932fb0e1911d3a75da204eff023ee5e0e79c1751564221a5c8"}, + {file = "numpy-2.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6790654cb13eab303d8402354fabd47472b24635700f631f041bd0b65e37298a"}, + {file = "numpy-2.0.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:cbab9fc9c391700e3e1287666dfd82d8666d10e69a6c4a09ab97574c0b7ee0a7"}, + {file = "numpy-2.0.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:99d0d92a5e3613c33a5f01db206a33f8fdf3d71f2912b0de1739894668b7a93b"}, + {file = "numpy-2.0.1-cp312-cp312-win32.whl", hash = "sha256:173a00b9995f73b79eb0191129f2455f1e34c203f559dd118636858cc452a1bf"}, + {file = "numpy-2.0.1-cp312-cp312-win_amd64.whl", hash = "sha256:bb2124fdc6e62baae159ebcfa368708867eb56806804d005860b6007388df171"}, + {file = "numpy-2.0.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:bfc085b28d62ff4009364e7ca34b80a9a080cbd97c2c0630bb5f7f770dae9414"}, + {file = "numpy-2.0.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:8fae4ebbf95a179c1156fab0b142b74e4ba4204c87bde8d3d8b6f9c34c5825ef"}, + {file = "numpy-2.0.1-cp39-cp39-macosx_14_0_arm64.whl", hash = "sha256:72dc22e9ec8f6eaa206deb1b1355eb2e253899d7347f5e2fae5f0af613741d06"}, + {file = "numpy-2.0.1-cp39-cp39-macosx_14_0_x86_64.whl", hash = "sha256:ec87f5f8aca726117a1c9b7083e7656a9d0d606eec7299cc067bb83d26f16e0c"}, + {file = "numpy-2.0.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1f682ea61a88479d9498bf2091fdcd722b090724b08b31d63e022adc063bad59"}, + {file = "numpy-2.0.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8efc84f01c1cd7e34b3fb310183e72fcdf55293ee736d679b6d35b35d80bba26"}, + {file = "numpy-2.0.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:3fdabe3e2a52bc4eff8dc7a5044342f8bd9f11ef0934fcd3289a788c0eb10018"}, + {file = "numpy-2.0.1-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:24a0e1befbfa14615b49ba9659d3d8818a0f4d8a1c5822af8696706fbda7310c"}, + {file = "numpy-2.0.1-cp39-cp39-win32.whl", hash = "sha256:f9cf5ea551aec449206954b075db819f52adc1638d46a6738253a712d553c7b4"}, + {file = "numpy-2.0.1-cp39-cp39-win_amd64.whl", hash = "sha256:e9e81fa9017eaa416c056e5d9e71be93d05e2c3c2ab308d23307a8bc4443c368"}, + {file = "numpy-2.0.1-pp39-pypy39_pp73-macosx_10_9_x86_64.whl", hash = "sha256:61728fba1e464f789b11deb78a57805c70b2ed02343560456190d0501ba37b0f"}, + {file = "numpy-2.0.1-pp39-pypy39_pp73-macosx_14_0_x86_64.whl", hash = "sha256:12f5d865d60fb9734e60a60f1d5afa6d962d8d4467c120a1c0cda6eb2964437d"}, + {file = "numpy-2.0.1-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:eacf3291e263d5a67d8c1a581a8ebbcfd6447204ef58828caf69a5e3e8c75990"}, + {file = "numpy-2.0.1-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:2c3a346ae20cfd80b6cfd3e60dc179963ef2ea58da5ec074fd3d9e7a1e7ba97f"}, + {file = "numpy-2.0.1.tar.gz", hash = "sha256:485b87235796410c3519a699cfe1faab097e509e90ebb05dcd098db2ae87e7b3"}, +] + [[package]] name = "overrides" version = "7.7.0" @@ -3233,4 +3287,4 @@ test = ["big-O", "importlib-resources", "jaraco.functools", "jaraco.itertools", [metadata] lock-version = "2.0" python-versions = "^3.12" -content-hash = "d4c7e8838c230fe344a9f3e18f80d218ae613fd5d43d6006b3cb5d676f086e7a" +content-hash = "ff34a80b8bcc362a4563d2d50101988b767c4355d6db05bb64c49b8ff9e0234f" diff --git a/pyproject.toml b/pyproject.toml index eb1df34..66deb03 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,6 +13,7 @@ jupyterlab = "^4.2.4" black = "^24.4.2" isort = "^5.13.2" jupyterlab-code-formatter = "^3.0.0" +numpy = "^2.0.1" [build-system]