pandas is used to turn files and survey-sized tables into questions you can answer. Its core workflow is practical: load data, shape indexes and columns so they reflect the problem, compute results, and inspect what comes back. section 8.4 section 13.4
A Series is a labeled sequence. Labels are not decoration: when two Series are combined, pandas matches values by index rather than by physical position. Operations return new Series, preserving the relevant index. section 1.7
Common analytical moves include:
- Read CSV, JSON, and HTML-table inputs, controlling parsing, column selection, and dtypes when needed. section 3.24
- Use vectorized arithmetic and comparisons; scalar operations broadcast across a Series, while boolean results can act as masks. section 1.7
- Select by labels with .loc or positions with .iloc, then summarize slices with methods such as mean. section 1.3
- Clean, filter, group, join, reshape, and compare data frames to answer larger questions. section 8.4
- Work with text through the str accessor and visualize data through pandas’ simplified Matplotlib API. section 9.13 section 11.21
Adjusting a month-indexed score Series
Generate ten scores, assign month labels, and compute their mean. If the goal is an average of 80, calculate 80 minus the current mean, then add that scalar to the Series. Broadcasting adjusts every score; using the mean first connects a scalar calculation back to labeled data. section 1.3 section 1.7
Analyzing developer surveys
A large survey can be made easier to navigate by converting flat dotted column names into a MultiIndex. From there, select a column or group, count values, filter respondents, group by country, calculate proportions, join another survey, and build pivot tables for compensation comparisons. section 8.2
py_filename = '../data/2020_sharing_data_outside.csv' py_df = pd.read_csv(py_filename)
Load a Python survey CSV into a data frame; larger inputs may require dtype or memory decisions before analysis. section 8.2
The transferable habit is to reason about shape and labels before chaining methods: decide whether the operation should produce a scalar, Series, or data frame, then verify the returned object and extend the analysis with another question. section 1.7 section 13.4










