Pick Two Columns
people has columns name, team, salary and age. Return a DataFrame with only the columns name and salary (in that order), rows in their original order.
Example 1
people {"name":["Ana","Ben"],"team":["x","y"],"salary":[10,20],"age":[30,40]}
returns {"columns":["name","salary"],"rows":[["Ana",10],["Ben",20]]}
Keep name and salary only.
Constraints
- The tables are small
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.
More pandas problems
- Rename ColumnsBeginner
- Running Sales TotalBeginner
- Sorted Unique ValuesBeginner
- Swap the LabelsBeginner
- Table ShapeBeginner
- Top ScoresBeginner
- Upper QuartileBeginner
- Wanted StatusesBeginner