NumPy Study Part 7: Math, Rounding, Missing Values and Linear Algebra (sqrt, round, isnan, dot, @, linalg)
This part collects the numerical tools you reach for every day:Math functions: powers, roots, logs, exponentials, absolute valuesRounding: round, floor, ceil, trunc, and a surprise about .5Missing values: nan, isnan, the nan-functions, filling and droppingFloating-point comparison: why 0.1 + 0.2 == 0.3 is False, and iscloseLinear algebra: dot products, @, identity, inverse, determinant, solving ..
2026. 10. 12.
NumPy Study Part 6: Combine, Split, Sort and Count (concatenate, stack, split, sort, argsort, unique, clip)
Real data rarely arrives in one tidy array. You load it in pieces, add new rows, split it into training and test sets, rank it, and count categories. This part covers the tools for all of that:Combining: concatenate, stack, vstack, hstack, column_stackAdding values: append, insert, delete (and why to use them sparingly)Splitting: split, array_splitSorting and ranking: sort, argsort, partition, t..
2026. 10. 12.
NumPy Study Part 4: Mastering axis (sum, mean, std, max, argmax, cumsum and keepdims)
If there is one parameter that confuses almost everyone learning NumPy, it is axis. "Does axis=0 mean rows or columns?" is one of the most searched NumPy questions.By the end of this part you will have a mental model that answers that question every time, and you will know the full family of aggregation functions that use it: sum, mean, std, min, max, argmin, argmax, cumsum, percentile, and more..
2026. 10. 12.
NumPy Study Part 3: Indexing, Slicing, Boolean Masks and np.where (Get Exactly the Data You Want)
Creating arrays is step one. The thing you will do most often after that is selecting part of an array: one value, a row, a column, a block, or "every value greater than 50".NumPy gives you four selection tools, and this part covers all of them:Basic indexing: one element, a[2] or m[1, 3]Slicing: ranges, a[2:5] or m[:, 1]Fancy indexing: a list of positions, a[[0, 3, 4]]Boolean masks: a condition..
2026. 10. 12.
NumPy Study Part 2: Inside an Array (shape, ndim, dtype, astype, reshape, flatten, newaxis)
In Part 1 we created arrays. Now let's open one up. Most NumPy errors you will ever see, such as "operands could not be broadcast together" or "cannot reshape array", come down to two properties: shape and dtype. Once you can read those at a glance, debugging NumPy code becomes much easier. 1. The five attributes to check firstCODEimport numpy as npa = np.array([[1, 2, 3], [4, 5, 6]..
2026. 10. 12.