170. Split Delimited Column into Separate Columns with Pandas
Beginner Mode
Start your terminal to use beginner mode.
Scenario
A CSV file contains a column with comma-delimited data that needs to be split into separate columns for easier analysis.
Task
Write a Python script at /home/interview/split_columns.py using pandas that reads /home/interview/data.csv, splits the full_info column into separate columns (first_name, last_name, age), and saves the result to /home/interview/split_data.csv.
Note: pandas is already installed.
Example
Input (data.csv):
id,full_info
1,"John,Doe,30"
2,"Jane,Smith,25"
Expected output (split_data.csv):
id,first_name,last_name,age
1,John,Doe,30
2,Jane,Smith,25
Terminal requires a larger screen
Open this page on a desktop or tablet (≥ 768px) to launch the terminal and practice hands-on.
Linux Terminal Environment
Write and execute your solution in the terminal below.
Essential
SQL 0/33
Git 0/15
Spark 0/20
Snowflake 0/22
Python 0/24
Need more practice in this area? Explore more questions →
Snowflake
TCS
X
Accenture
Adobe
Google
LinkedIn
Samsung
Datadog
Wix
Dropbox
Meta
OpenAI
Hulu
Uber
DoorDash
Anthropic
Amazon
ActivisionBlizzard
Vercel
Crypto.Com
Zscaler
DeutscheBank
Apple
GoDaddy
BMW
PayPal
AMD
Twilio
Atlassian
JPMorgan
NVIDIA
IBM
Databricks
Coinbase
Cisco
Robinhood
Twitter
Microsoft
Palantir
Netflix
VMware
Cloudflare
Stripe
Capital One
Splunk
Intel
SAP
Tesla
GitHub
JaneStreet
Bloomberg
Salesforce
Elastic
CGI
UBS
GitLab
Ubisoft
Slack
Nintendo
EY
Kayak
Lyft
Airbnb
Walmart
Revolut
Visa
Okta
HashiCorp
Instacart
Mastercard