Pick two columns
From the emp table, keep only the name and salary columns, in that order. The result is a DataFrame with every row.
Data
emp
| emp_id | name | dept | salary | city | years | |
|---|---|---|---|---|---|---|
| 0 | 1 | Ava Chen | Sales | 62000 | Boston | 3 |
| 1 | 2 | Ben Ortiz | Engineering | 98000 | Austin | 6 |
| 2 | 3 | Cara Patel | Marketing | 71000 | Boston | 4 |
| 3 | 4 | Dev Singh | Engineering | 105000 | Denver | 9 |
| 4 | 5 | Elena Rossi | Sales | 58000 | Austin | 1 |
| 5 | 6 | Femi Okafor | Finance | 80000 | Denver | 7 |
| 6 | 7 | Gina Park | Marketing | 66000 | Austin | 2 |
| 7 | 8 | Hugo Lind | Engineering | 91000 | Boston | 5 |
Tab indents, Ctrl+Enter runs. pandas is imported as pd and numpy as np.
Your resultExpected: DataFrame, 8 rows x 2 columns: name, salary
Run your code to see result here. Check runs it on the sample data and on a second dataset.