Pandasdrill
Selecting and filtering1 / 45

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_idnamedeptsalarycityyears
01Ava ChenSales62000Boston3
12Ben OrtizEngineering98000Austin6
23Cara PatelMarketing71000Boston4
34Dev SinghEngineering105000Denver9
45Elena RossiSales58000Austin1
56Femi OkaforFinance80000Denver7
67Gina ParkMarketing66000Austin2
78Hugo LindEngineering91000Boston5
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.