Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Here is a link to my excel spreadsheet (only 2 columns with column A being the only column that our code will use to produce

Here is a link to my excel spreadsheet (only 2 columns with column A being the only column that our code will use to produce automated results in a new column C.)
https://mymaildrury-my.sharepoint.com/:x:/g/personal/jtrentii_drury_edu/EftsWuJP2X5EqOouggNXd4QBqRD-G2uZAmm6WhDYDTyODg?e=lMfQ6G
I asked the following question last night on Chegg but this code they gave me is just setting the two columns to have the same value. I need the code to search for the strings Dell, Lenovo, HP, Microsoft Surface, or VMWare Virtual Machine within the cell in column A. Depending on which of these strings it finds within the entire entry in column As cell, it should write one of these 4 strings to the corresponding row in column Cs cell. Else if it doesnt find any of the four, it would write Other to the corresponding row in column C. For example, if Column A2s cell contained the string Dell Inspiron 7000 5469, the correct code would write Dell to column C2s cell. Every cell in column A will have one of the four strings Dell, Lenovo, HP, Microsoft Surface, or VM Virtual Machine within it. If it doesnt contain one of those strings, I want the corresponding cell in column. 3 to have the string Other written to it. The code as written simply sets the two column values equal to each other. I dont want that. Here is the code that Chegg responded with last night but is incomplete.
image text in transcribed
import openpyxl wb openpyxl.load workbook(path) sheet wb.active for i in range(sheet.max_row): 1) 3) wb.save(path) cell l sheet.cell(row = i, column = cell2 = sheet.cell(row-i, column = cell2.valuec.value

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_2

Step: 3

blur-text-image_3

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

Semantics In Databases Second International Workshop Dagstuhl Castle Germany January 2001 Revised Papers Lncs 2582

Authors: Leopoldo Bertossi ,Gyula O.H. Katona ,Klaus-Dieter Schewe ,Bernhard Thalheim

2003rd Edition

3540009574, 978-3540009573

More Books

Students also viewed these Databases questions

Question

What would you do to evaluate a group

Answered: 1 week ago