Skip to main content
pelatihan
.org
Learn. Practice. Grow.
Category
EN
Sign in
Sign up
Menu
NumPy Curriculum: 4 Chapters, 44 Lessons — pelatihan.org
Home
/
Catalog
/
NumPy
/
Curriculum
Curriculum
NumPy Curriculum
Learn NumPy online with 44 structured lessons, code examples, and 220 quiz questions.
44 lessons
4 chapters
220 questions
Summaries and key points are free to preview. Full lessons, code examples, and quizzes require a subscription.
01
NumPy Tutorial
16 lessons
01
NumPy HOME
NumPy is the core Python library for numerical computing, most famous for its fast, memory-efficient, multidimensional arrays. Almost the entire Python data ecosystem like…
02
NumPy Intro
NumPy (Numerical Python) is an open source library for data science that provides multidimensional array objects as well as ready-made mathematical and statistical functions.…
03
NumPy Getting Started
Starting NumPy is just by importing the modules, usually with the alias np, and then creating an array of lists or tuple. Once the array is formed, you can immediately run a…
04
NumPy Creating Arrays
NumPy provides many ways to create an array: from a list with np.array, an array containing zero or one with np.zeros and np.ones, as well as a sequential array with np.arange…
05
NumPy Array Indexing
Indexing on the NumPy array allows access to both single and multiple elements at once. For a one-dimensional array, indexing is similar to Python list: arr[0] for the first…
06
NumPy Array Slicing
Slicing allows you to take array snippets with syntax, similar to Python slicing lists but per dimension. In a 2D array, you can cut rows and columns at the same time like a[0:2,…
07
NumPy Data Types
Each NumPy array has a single data type (dtype) that determines how elements are stored in memory. Common types include int, float, string, and boolean; you can check them…
08
NumPy Copy vs View
The key difference in NumPy is between copying and viewing. Copy creates a new array object with its own data, whereas view only points to the memory block belonging to the…
09
NumPy Array Shape
Shape is a tuple that describes the number of elements in each dimension of an array. You can read the shape through the .shape attribute, calculate dimensions with .ndim, number…
10
NumPy Array Reshape
Reshape changes the shape of the array without changing the number or sequence of the data, as long as the total of the elements remains the same. Parameter -1 asks NumPy to…
11
NumPy Array Iterating
NumPy array iteration can be performed with regular for iterations for a one-dimensional array, whereas a multidimensional array requires a np.nditer function to make each…
12
NumPy Array Join
An array merger is done with np.concatenate that connects data on a particular axis. np.stack is different: it creates a new dimension of flat arrays. Also available are vstack…
13
NumPy Array Split
The array splitting is done by np.array_split which divides the array into several sized parts that may not be the same. There are also hsplits for column breakdown and vsplits…
14
NumPy Array Search
Searching in NumPy arrays is done with np.where looking for positions based on certain conditions. np.searchsorted looking for insertion indexes so that the array remains sorted,…
15
NumPy Array Sort
Returns a copy of the sorted array without changing the original array. You can sort by row or column over the axis parameter, and then choose the algorithm with the kind…
16
NumPy Array Filter
Array filtering uses boolean indexing, which is to place conditions such as arr > 10 in square brackets. The result contains only qualifying elements, so it replaces the if…
02
NumPy Random
15 lessons
01
Random Intro
The np.random module provides a random number generator for simulation, model weight initialisation, and data sharing. Functions generally include random, randint, and choice,…
02
Data Distribution
Data distribution describes the probability distribution of a value in a data set. NumPy provides a function to generate data from a variety of distributions, and then the…
03
Random Permutation
Permutation is used to randomly sort the order of an array element, useful in the division of training and test data. np.random.permutation returns a random copy, whereas…
04
Seaborn Module
Seaborn is a Python visualization library built on matplotlib and often used with NumPy to plot data distribution. A function such as a distplot (now called a histplot/displot)…
05
Normal Distribution
The normal distribution (gauss) is the most common distribution in statistics, forming a symmetrical bell around the mean. It produces random data with loc as the mean and scale…
06
Binomial Distribution
A binomial distribution describes the results of a number of independent experiments that have only two possibilities: successful or failed. A classic example is the correct…
07
Poisson Distribution
Poisson's distribution describes the number of events occurring over a given time span or area when occurring rarely and randomly. An example is the number of subscribers per…
08
Uniform Distribution
A uniform distribution produces the same random value of the probability across the entire range between the left and right boundaries. Suitable for simple simulations like dice…
09
Logistic Distribution
Logistic distributions are similar to normal but have thicker tails, so they are often used in logistics regression analysis and classification models. The curve is S-shaped…
10
Multinomial Distribution
A multinomial distribution is a binomial generalization for more than two categories. np.random. multinomial(n, pvals, size) returns the success rate of each category of n…
11
Exponential Distribution
The exponential distribution describes the waiting time between events that occur continuously at a constant average rate. Examples are generally the interval between customer…
12
Chi Square Distribution
The chi-square distribution is the sum of the squares of the normal random variables of the free standard. The chi-square test in statistics uses this distribution to test the…
13
Rayleigh Distribution
The Rayleigh distribution is used for the magnitude of the result of two normal random components of equal variance. Its applications are widely found in wave physics, wind…
14
Pareto Distribution
The Pareto distribution is a weighted tail distribution that describes inequality, such as the distribution of wealth or the size of a city. Pareto's famous law (80/20) is rooted…
15
Zipf Distribution
Zipf distribution describes a pattern in which the most popular elements appear much more frequently than other elements, such as the frequency of words in a language. This…
03
NumPy ufunc
13 lessons
01
ufunc Intro
Universal function (ufunc) is a function that works on all elements of an array element-wise at high speed because it is implemented in C. For example, np.add, np.subtract,…
02
ufunc Create Function
If the built-in function is not enough, you can create your own ufunc with np.frompyfunc that accepts the ordinary Python function and applies it to the entire element array.…
03
ufunc Simple Arithmetic
NumPy provides simple arithmetic functions such as add, subtract, multiply, divide, power, mod, and divmod which are all element-wise. Keep in mind that division produces a…
04
ufunc Rounding Decimals
NumPy provides several ufunc for rounding decimal numbers: around (round), floor, ceil, and trunc. Each function has a different behavior to a negative and half value (0.5). The…
05
ufunc Logs
NumPy provides ufunc logarithms: np.log (base e), np.log2 (base 2), and np.log10 (base 10). The logarithm is only defined for positive numbers, so a zero or negative input will…
06
ufunc Summations
Np.sum sums all of the elements of the array or along a particular axis, whereas np.cumsum results in a cumulative running from each position. A similar concept applies to…
07
ufunc Products
Np.prod calculates the multiplication of the entire array element, whereas np.cumprod produces a series of cumulative multiplication. Just like addition, axis parameters are…
08
ufunc Differences
Calculating the difference between successive elements in an array is very useful for analyzing changes or differences in time series data. You can repeat the difference many…
09
ufunc Finding LCM
Calculates the smallest common multiple (LCD) of two integers, both scalar and array. This function is element-wise so you can count multiple pairs at once. The concept of LCM…
10
ufunc Finding GCD
Calculates the greatest common factor (FPB) of two integers, both in scalar form and in element-wise arrays. GCD values are very useful for simplifying fractions and determining…
11
ufunc Trigonometric
NumPy provides trigonometric functions such as np.sin, np.cos, and np.tan that work element-wise on an array. The input must be in units of radian; use np.degrees() to convert…
12
ufunc Hyperbolic
Hyperbolic functions such as np.sinh, np.cosh, and np.tanh are exponential shapes that resemble trigonometric waves, but are not repeatable. np.tanh is important in machine…
13
ufunc Set Operations
NumPy provides set operations such as np.unique for unique, np.union1d for combined, np.intersect1d for slices, as well as np.setdiff1d and np.setxor1d for symmetrical…