A pandas Series is a one-dimensional sequence of values paired with an index. Think of it as one labeled measurement: monthly test scores, daily temperatures, taxi passenger counts, or a single column from a table. A DataFrame is largely a collection of Series that share an index, so understanding Series makes column-wise pandas work easier to reason about. section 1.0 section 2.0
Use the column view to connect a one-dimensional Series to the two-dimensional DataFrame it helps compose. section 1.0
Create a Series from an iterable such as a Python list or NumPy array, optionally supplying labels as its index. The index is more than display metadata: use .loc to retrieve by label and .iloc to retrieve by position. Labels can repeat; selecting a repeated label then returns every matching value rather than a single scalar. section 1.3 section 1.19
Treat the index as the organizing principle for common Series operations:
- Select values by labels with .loc, by integer positions with .iloc, or by slices when comparing parts of a sequence. section 1.3
- Combine two Series with vectorized arithmetic; matching happens by index labels, not by their physical positions. section 1.7
- Combine a Series with one scalar through broadcasting, producing a new Series with the same index. section 1.7
- Build a boolean Series with comparisons, then use it as a mask to select or update only True positions. section 1.13
Analyze and adjust labeled test scores
For scores indexed by month, calculate a yearly mean, compare first- and second-half averages, and measure improvement. To shift the whole Series toward a target average, compute the scalar difference between the target and s.mean(), then add it to s; broadcasting applies that adjustment to every labeled score. section 1.2 section 1.7
Series methods return either a scalar or another Series. For example, mean returns one number, while describe returns a Series of count, mean, standard deviation, minimum, quartiles, median, and maximum. This return shape matters: a returned Series can be indexed, sorted, or passed into further operations. section 1.15 section 1.0
A one-column CSV can become a Series by reading it into a one-column DataFrame and calling squeeze. From there, value_counts creates a new Series whose index holds distinct observed values and whose values hold frequencies; normalize=True turns those counts into proportions. section 1.23
Filter and summarize taxi rides
Load passenger counts, use value_counts(normalize=True) to compare one- and six-passenger ride proportions, or turn ride distances into short, medium, and long categories and count each category. These tasks favor vectorized Series operations over explicit Python loops. section 1.22 section 1.26



