Bahasa

Referensi Cepat NumPy

Cheat sheet siap cetak untuk Referensi Cepat NumPy, disusun untuk pencarian cepat, belajar, dan referensi di meja

Sumber
NumPy Documentation (numpy.org)
Lisensi
MIT
Diperbarui
2026-03-27

Contoh

Isi cheat sheet ini

  • Pembuatan Array
  • Indexing & Slicing
  • Operasi Array
  • Fungsi Matematika
  • Aljabar Linear
  • Random
  • Reshaping
  • Broadcasting
  • File I/O
  • Pola Umum

Dari List

import numpy as np
a = np.array([1, 2, 3])        # 1D
b = np.array([[1, 2], [3, 4]])  # 2D

Konstruktor Bawaan

np.zeros((2, 3))     # 2x3 berisi nol
np.ones((3, 3))      # 3x3 berisi satu
np.eye(4)            # matriks identitas 4x4
np.arange(0, 10, 2)  # [0, 2, 4, 6, 8]
np.linspace(0, 1, 5) # 5 titik berspasi merata

Properti Array

a.shapeDimensi sebagai tuple: `(3, 4)`
a.ndimJumlah dimensi
a.sizeTotal jumlah elemen
a.dtypeTipe data: `float64`, `int32`, dll.

Unduh cheat sheet lengkap dengan semua bagian, siap cetak

Unduh PDF

Unduhan

Pilih varian yang sesuai dengan cara Anda membaca