NumPy Indexing and Slicing: Views, Masks and Fancy Indexing (Part 2)
NumPy indexing and slicing explained: why editing a slice changes your original array, when masks and fancy indexing copy instead, and how to avoid both bugs.
Search
6 articles matched your search.
NumPy indexing and slicing explained: why editing a slice changes your original array, when masks and fancy indexing copy instead, and how to avoid both bugs.
Python strings in practice: f-strings, slicing, the methods worth memorising, why += loops slow down, and the encoding default that breaks scripts on Windows.
NumPy tutorial for beginners: what an array is, why it ran about 20 times faster than a list here, how one stray string turns numbers into text, and more.
NumPy broadcasting explained: the two shape rules, why a (3,1) and a (4,) array give (3,4), and the silent bug that turns a vector sum into a matrix.
NumPy aggregation along axes, NaN-safe statistics, argmax, sorting and linalg.solve, plus why NumPy and pandas return different standard deviations.
How to use Python tuples well: creating them, unpacking, using them as dict keys, named tuples, and the one-element and += gotchas that catch everybody.