Problem 4: Remove Irrelevant Columns
Easypython
Problem Description
Write a Python program that takes a DataFrame with an irrelevant "internaltrackingid" column and removes it, printing the DataFrame's columns before and after.
Input
A DataFrame containing at least one irrelevant column alongside relevant ones.
Output
The list of column names before and after removal.
Constraints
- The column to remove will be explicitly specified.
Example Input
textcolumns = ["name", "age", "marks", "internal_tracking_id"]
Example Output
textBefore: ['name', 'age', 'marks', 'internal_tracking_id'] After: ['name', 'age', 'marks']
Concepts Covered
df.drop(columns=[...]).