Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Overall point: create a special data structure that will be a list of numbers Write a code ( python ) that reads a csv file
Overall point: create a special data structure that will be a list of numbers
Write a code python that reads a csv file and can run these codes on it code below
Some criteria:
# read data from disk, and create a list of the calculation lists.
# process those lists to get actual outputs.
#outputs processCalculationListscalculationListLoaderinputscsv outputfile"output.csv
#outputs.head
Example table of input file contents
Name Type Threshold Value Value Value
list stdList
list stdList
list meanList
Example table of output file contents what we tryna do with the code
Name Length Threshold Value
list
list
list
code currently:
from typing import MutableSequence
from abc import ABC, abstractmethod
import numpy as np
class CalculationListMutableSequence ABC:
def initself data:
self.data data
@abstractmethod
def pruneself:
pass
def delitemself index:
del self.dataindex
def getitemself index:
return self.dataindex
def lenself:
return lenselfdata
def setitemself index, value:
self.dataindex value
class StdListCalculationList:
def pruneself:
meanval npmeanselfdata
stdval npstdselfdata
threshold stdval self.data.threshold
indicestoremove npwherenpabsselfdata meanval threshold
self.data npdeleteselfdata, indicestoremove
class MeanListCalculationList:
def pruneself:
meanval npmeanselfdata
threshold self.data.threshold
indicestoremove npwherenpabsselfdata meanval threshold
self.data npdeleteselfdata, indicestoremove
class SumListCalculationList:
def pruneself:
sumval npsumselfdata
threshold self.data.threshold
indicestoremove npwhereselfdata threshold
self.data npdeleteselfdata, indicestoremove
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