BuildlyBuildly
DashboardExercisesProfileHelp
Data Science/Module 2: Data Analytics/Selection & Indexing2/3
Exercise·7 min·10 XP

Pick a Single Column

Context. Extract a single column from a DataFrame for further analysis.

Your task. Write get_scores(df) that returns the score column as a pandas Series (not a single-column DataFrame).

Example. A df with name and score → the score Series.

Notes. df["score"] returns a Series; df[["score"]] (double-bracket) would return a DataFrame — we want the first. Empty df → empty Series.

Previous
Parse CSV and Filter
Next
Slice Rows by Position