Question: 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
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
