What does pandas do?
pandas introduces two key objects to Python, series and DataFrames, with the latter arguably being the most useful, but pandas DataFrames can be thought of as series bound together. A series is a sequence of data, like a list in basic Python or a 1D NumPy array. And, like the NumPy array, a series has a single data type, but indexing with a series is different. With NumPy there is not much control over row and column indices; but with a series, each element in the series must have a unique index, name, key, however you want to think about it. The index could consist of strings, such as cities in a nation, with the corresponding elements of the series denoting some statistical value, such as the city's population; or dates, such as trading days for a stock series.
A DataFrame can be thought of as multiple series of common length, with a common index, bound together in a single tabular object. This object resembles a NumPy 2D ndarray
, but it is not the same thing. Not all...