Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hello there. This time I'm trying to Fix an error with a script that keeps crashing. I've tried adding the Missing column with lastname but

Hello there.

This time I'm trying to Fix an error with a script that keeps crashing. I've tried adding the Missing column with "lastname" but it didn't execute the script.

Could you please help me edit this script using Neno and debug the issue?>

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

Missing ColumnError Let's check the data.csv file for the missing column name. cat ~/data.csv Output: student-00-d6ce1d22e3ea@linux-instance:-$ cat -/data.csv firstname, surname, job title Oliver, Jefferson, Quam Vel Corporation, IT Resident Xenos, Snow, Tellus LLC, CTO Emerson, Delgado, Sagittis Ltd, CFO Ignatius, Henderson, Id Risus Quis Ltd, CTO Abel, Burnett, Dui Cum sociis Limited, CEO Dustin, Daugherty, Pharetra Corp., IT Resident Thaddeus, Macdonald, Magna Nam Ligula LLP, CTO Guy, Chen, Dictum Eu LLP, IT Resident So, the column name is actually missing. Let's add the column name and run the script again. Grant the permissions to the data.csv file. sudo chmod 777 ~/data.csv So, the column name is actually missing. Let's add the column name and run the script again. Grant the permissions to the data.csv file. sudo chmod 777 ~/data.csv Open data.csv file using nano editor. nano ~/data.csv Add the missing column name and save the file by clicking Ctrl-o, followed by Enter key and Ctrl-x. Now, run the script again: python3 /usr/bin/infrastructure Output: student-00-59248518082e@linux-instance: $ python3 /usr/bin/infrastructure student-00-59248518082e@linux-instance:-$ P appleowner - student-04-02a305380c64@linux-instance:/- ssh -i -/Dow... Brock, Lindsey, Tristique Institute, CEO Lee, Collier, Pede Consulting, CEO Grant, Morin,Donec Tempus Institute, IT Resident Griffin, Jones, Donec Egestas Foundation, IT Resident Ulric, Bradshaw, At Nisi LLC, CFO student-04-02a305380c64@linux-instance:/$ sudo chmod 777 ./data.csv [student-04-02a305380c64@linux-instance: $ nano /data.csv ] [student-04-02a305388c64@linux-instance: $ nano /data.csv ] [student-84-92a365388c64@linux-instance: $ python3 /usr/bin/infrastructure [Missing ColumnError: Could not find column company in data.csv student-84-92a365388c64@linux-instance: $ python3 /usr/bin/infrastructure [Missing ColumnError: Could not find column company in data.csv ] student-04-02a305380c64@linux-instance: $ nano n/data.csv (student-04-02a305380c64@linux-instance: $ python3 /usr/bin/infrastructure ] [Traceback (most recent call last): ] File "/usr/bin/infrastructure", line 23, in csv_data = np.genfromtxt(f, delimiter=',',dtype=str) File "/home/student-84-82a305380c647.local/lib/python3.5/site-packagesumpy/li bpyio.py", line 2103, in genfromtxt raise ValueError(errmsg) ValueError: Some errors were detected ! Line #2 (got 4 columns instead of 3) Line #3 (got 4 columns instead of 3) Line #4 (got 4 columns instead of 3) appleowner - student-04-02a305380c64@linux-instance:/- ssh -i -/Dow... GNU nano 2.7.4 File: /home/student-04-02 a 305380c64/data.csv Modified firstname, surname, job title, Oliver, Jefferson, Quam Vel Corporation, IT Resident Xenos, Snow, Tellus LLC,CTO Emerson, Delgado, Sagittis Ltd, CFO Ignatius, Henderson, Id Risus Quis Ltd, CTO Abel, Burnett, Dui Cum sociis Limited, CEO Dustin, Daugherty, Pharetra Corp., IT Resident Thaddeus, Macdonald, Magna Nam Ligula LLP, CTO Guy, Chen, Dictum Eu LLP, IT Resident Ulysses, Mcgowan, Aliquam Adipiscing Lacus Incorporated, CFO Clinton, Ellis,Placerat velit Limited, CTO Dolan, Cohen, Sed LLP, IT Resident Theodore, Ford, Montes Nascetu Ridiculus Limited, IT Resident Carson, Sykes, Non Dapibus PC, IT Resident Ulric,Mercer, orci Lobortis Associates, CEO Jackson, Dotson, Eget Tincidunt Dui Corporation, CEO Elliott, Rojas, Nec Metus Facilisis PC, CFO Judah,Salinas, Orci Foundation, CTO Ryan, Potter, Dignissim Consulting, CEO G Get Help no Write Out W Where Is AK Cut Text Justify -X Exit -R Read File Replace LU Uncut Text T To Spell AC Cur Pos Go To Line

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

Programming The Perl DBI Database Programming With Perl

Authors: Tim Bunce, Alligator Descartes

1st Edition

1565926994, 978-1565926998

More Books

Students also viewed these Databases questions

Question

What is your role within these groups?

Answered: 1 week ago

Question

How to reverse a Armstrong number by using double linked list ?

Answered: 1 week ago