Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Posting question again as requested https://www.coursehero.com/qa/wait/30686928/ Team Looking for expert advice for the usage of python/pandas with dataframe option to deal with file handling to
Posting question again as requested "https://www.coursehero.com/qa/wait/30686928/"
Team
Looking for expert advice for the usage of python/pandas with dataframe option to deal with file handling to convert semicolon to csv
Sample input_file contents
C0-lkb.abc.com:apple.feature.com:500 C0-rbs-out-1.regroup.com:retail.kfc.com:1800 Pwell.kbc.com:knowledge-use.com:::::200:1800 Zaadick.lkb.com:hoster-make.com::400
Note : File contains records starting with various first letter field . ex C,P,Z,$,# etc .
Expected output_file.csv
Name,Value apple.feature.com:0-lkb.abc.com retail.kfc.com:0-rbs-out-1.regroup.com
- Need to check for only rows which starts with "C" only.
- For records starting with "C" . Check only First and Second fields . Ignore other fields
- Output file should have header as Name,Value
- Second field from input file should be placed in First field of output file .
- First field from input file should be placed in Second field of output file. ( Expected sample output file is shared above)
Looking for best approach to handle using Python 3.7.5/pandas preferably using dataframe.
Thanks
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