ECON 3209 · Week 4, Lecture 1 · Kerala Agricultural University
Autumn 2026
By the end of this lecture, you will be able to:
Series and DataFrame objectsloc and iloc for labelled and positional indexingThink of pandas as a programmable spreadsheet that is easier to audit, repeat, and scale.
Series is a one-dimensional labelled object.mean() work directly on the dataDataFrame is a two-dimensional table.head() shows the first rows.info() reports column names, non-null counts, and data typesSeriesDataFrameloc for Label-Based Indexingloc selects by row and column labelsloc supports lists of labels and slicesiloc for Position-Based Indexingiloc selects by integer position.describe() quickly summarises numeric columnsCreate a DataFrame with three districts and columns for deposit_crore and loan_crore.
gap equal to deposits minus loans.loc to print the row for one district.gap is greater than 20.Series handle one variable; DataFrame handles many variables togetherloc uses labels and iloc uses positionsECON 3209 — Kerala Agricultural University