Question
need help in python using panda dataframe for this coding practice Load the dataset file into a variable named df and do the following: 1.
need help in python using panda dataframe for this coding practice
Load the dataset file into a variable named df and do the following: 1. Perform the merge of the FIRST_NAME and CITY columns separated by a , (comma) only for students with MAJOR_DESC = Biology and store them in another variable called "series" (This variable will be "m" rows by 1 column).
2. Transform series(mx1) to a single row and 1 column by concatenating all rows and save it to another variable out (separated by commas)
3. Save the result contained in out to a file outFile_1.CSV
NOTE: Use a for loop to automatically produce the 1 outFile_*.CSV files for Biology. The general idea is presented in the following figure.
______> outfile_1.csv
dataset.csv
FIRST_NAME | CITY | MAJOR_DESC | GPA |
ABIMAEL | Manati | CRIMINAL JUST FORENSIC INVEST | 3.18 |
ADIAN | Carolina | BUSINESS ADMIN GENERAL PROGRAM | 3 |
ADIELYS | San Juan | BUSINESS ADMIN GENERAL PROGRAM | 1.5 |
ADRIANA | Bayamon | BIOLOGY | 2.25 |
ADRIANA | Sabana Seca | CRIMINAL JUST FORENSIC INVEST | 2.9 |
ADRIANA | San Juan | CRIMINAL JUST FORENSIC INVEST | 3.26 |
ADRIANA | San Juan | MARKETING | 3 |
AIRAM | Bayamon | FORENSIC SCIENCES | 1.29 |
ALANIS | Corozal | COSMETOLOGY TECHNICIAN | 4 |
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started