ECON 3209 · Week 3, Lecture 1 · Kerala Agricultural University
Autumn 2026
By the end of this lecture, you will be able to:
ndarrayndarrayIn econometrics, NumPy lets us think in vectors and matrices rather than one observation at a time.
np.array() converts a Python list into an arraynp.zeros() and np.ones() create standard arrays quicklynp.arange() is useful for evenly spaced integer sequences.shape tells us rows and columns.size counts total elements.ndim shows number of dimensions.dtype tells us the numeric type such as int64 or float64[start:stop]stop position is excludedTrue and Falsedeposits[1:] means all but the first observationdeposits[:-1] means all but the last observationCreate a NumPy array called yields with values 3000, 3200, 2900, 3600, 3400.
200 to every value to represent improved irrigation.3300.3300..shape and .dtype describe structureECON 3209 — Kerala Agricultural University