שימו לב: על מנת להריץ את התאים ב-Live Code, יש לייבא תחילה את ספרית numpy ע”י הרצת השורת הבאה:
import numpy as np
סיכום פונקציות נפוצות בnumpy#
category |
name |
use |
|---|---|---|
Creation |
||
create a new ndarray from an object like a list or tuple |
||
create a new ndarray filled with zeros |
||
create a new ndarray filled with ones |
||
create an ndarray with evenly spaced values |
||
create an ndarray with random floats in [0, 1) |
||
create an ndarray with random integers in a given range |
||
Typing |
||
unsigned integer type between 0 and 255 |
||
default integer type |
||
Attribute access |
||
tuple describing the shape of the array |
||
transpose of the array |
||
Array manipulation |
||
change the shape of an array without changing its data |
||
return a sorted copy of an array |
||
limit values in an array to a given range |
||
stack arrays horizontally (column wise) |
||
stack arrays vertically (row wise) |
||
Numerical operations |
||
element wise absolute value |
||
natural logarithm, element wise |
||
base 2 logarithm, element wise |
||
base 10 logarithm, element wise |
||
Aggregation |
||
sum of elements, optionally along an axis |
||
mean of elements, optionally along an axis |
||
median value, optionally along an axis |
||
maximum value, optionally along an axis |
||
minimum value, optionally along an axis |
||
index of the maximum value |
||
index of the minimum value |
||
element wise maximum between two arrays |
||
element wise minimum between two arrays |
||
True if any element is True |
||
True if all elements are True |
||
indices of non zero elements |
||
compute histogram counts per bin |