Create a Single Python File with the Functions - IT/Computer Science Assignment Help

Download Solution Order New Solution
Assignment Task:

Task:

Create a single Python file with the functions requested below. Submit your challenge solution as a separate file – Lastname_Firstname_A2_challenge.py.

Task 1: Quality control [2 marks] Plastyco manufactures sheets of plastic and has a process that scans for defects in 100×100 grid locations. Sheets with defects can still be salvaged so long as the following conditions are met:

• There are no more than 8 defects overall • There are no more than 4 defects in any 3×3 square The image below shows 4 defects in a 3×3 square. A sheet with this set of defects could pass quality control. The next image shows 5 defects in a 3×3 square; this sheet would be rejected. Write a function is_sheet_usable(sheet), that takes a numpy array. In the array, if a grid location has a defect, the array will contain 1, otherwise it will contain 0. The function should return True if the pane can be used, otherwise False. Error checking If sheet is not a numpy ndarray, raise TypeError. If sheet has a shape other than 100×100, raise ValueError. If sheet contains values other than 0 or 1, raise ValueError.

Task 2: Combining CSVs [4 marks] Suppose we have a folder containing a large number of CSV files. Each CSV should have a column called key that should be used as the index. If the file does not have a key column, it should be skipped. Most of the files will have a similar set of columns, with some variations. We need to combine all the data from each file into a single DataFrame. Write a function combine_csv_files(directory, output_filename). • directory is the folder location where the files can be found

• output_filename is where the combined DataFrame should be saved

The above  IT Assignment has been solved by our  IT Assignment  Experts at onlineassignmentbank. Our Assignment Writing Experts are efficient to provide a fresh solution to this question. We are serving more than 10000+ Students in Australia, UK & US by helping them to score HD in their academics. Our experts are well trained to follow all marking rubrics & referencing style.

Be it a used or new solution, the quality of the work submitted by our assignment experts remains unhampered. You may continue to expect the same or even better quality with the used and new assignment solution files respectively. There’s one thing to be noticed that you could choose one between the two and acquire an HD either way. You could choose a new assignment solution file to get yourself an exclusive, plagiarism (with free Turnitin file), expert quality assignment or order an old solution file that was considered worthy of the highest distinction.

Get It Done! Today

Country
Applicable Time Zone is AEST [Sydney, NSW] (GMT+11)
+

Every Assignment. Every Solution. Instantly. Deadline Ahead? Grab Your Sample Now.