Arrays, broadcasting, vectorisation, DataFrames, groupby, joins and time series — the two libraries behind every Python data and ML screening round.
Preview — first 3 of 150 cards
What is an ndarray?
An N-dimensional, homogeneous (single dtype) array stored in contiguous memory. Attributes: shape, dtype, ndim, size, itemsize, strides, nbytes. Contiguity makes vectorized ops cache-friendly and fast.
a = np.array([[1,2],[3,4]])
a.shape, a.dtype, a.ndim, a.size
How do you create arrays?
np.array (from lists), zeros, ones, empty, full, arange, linspace, eye/identity, and random generators. Always consider specifying dtype to control memory and precision.
np.zeros((2,3))
np.arange(0,10,2)
np.linspace(0,1,5)
np.full((2,2), 7, dtype=np.int32)
arange vs linspace
arange(start, stop, step) is step-based and can miss the endpoint with floats; linspace(start, stop, num) is count-based and includes the endpoint by default. Prefer linspace for float ranges.
np.arange(0,1,0.1) # 10 pts, endpoint drift
np.linspace(0,1,11) # 11 pts incl. 1.0
147 more cards in this sheet
Unlock the Backend, Databases & AI bundle — ₹399
One-time payment. Unlocks this sheet and 14 other sheets in the bundle, plus a typeset PDF of each.
Unlock the bundle
See all bundles
Or get all 76 sheets for ₹999 — one payment, every future sheet included.