Answered step by step
Verified Expert Solution
Link Copied!

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 
  1. Need to check for only rows which starts with "C" only.
  2. For records starting with "C" . Check only First and Second fields . Ignore other fields
  3. Output file should have header as Name,Value
  4. Second field from input file should be placed in First field of output file .
  5. 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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Dental Assisting

Authors: Doni Bird, Debbie Robinson

13th Edition

978-0323624855, 0323624855

Students also viewed these Programming questions