CSV=Import_CSV()#call the Import_CSV module and using its method Input_data import the data set from the CSV file to the tool
JSONFileName='JSON_ConveyerLine.json',
procData=CSV.Input_data(filename1)
jsonFile=None,csvFile1=None,csvFile2=None):
sourceData=CSV.Input_data(filename2)
ifcsvFile2:
M1=procData.get('M1',[])#get from the returned Python dictionary the data sets
CSVFileName2=csvFile2.name
M2=procData.get('M2',[])
ifcsvFile1:
S1=sourceData.get('S1',[])
CSVFileName1=csvFile1.name
################### Processing of the data sets calling the following objects ###################################
CSV=Import_CSV()#call the Import_CSV module and using its method Input_data import the data set from the CSV file to the tool
#Replace missing values calling the corresponding object
procData=CSV.Input_data(CSVFileName2)
missingValues=HandleMissingValues()
sourceData=CSV.Input_data(CSVFileName1)
M1=missingValues.DeleteMissingValue(M1)
M1=procData.get('M1',[])#get from the returned Python dictionary the data sets
M2=missingValues.DeleteMissingValue(M2)
M2=procData.get('M2',[])
S1=missingValues.ReplaceWithMean(S1)
S1=sourceData.get('S1',[])
#Detect outliers calling the DetectOutliers object
################### Processing of the data sets calling the following objects ###################################
outliers=HandleOutliers()
#Replace missing values calling the corresponding object
M1=outliers.DeleteExtremeOutliers(M1)
missingValues=HandleMissingValues()
M2=outliers.DeleteExtremeOutliers(M2)
M1=missingValues.DeleteMissingValue(M1)
S1=outliers.DeleteOutliers(S1)
M2=missingValues.DeleteMissingValue(M2)
S1=missingValues.ReplaceWithMean(S1)
#Conduct distribution fitting calling the Distributions object and DistFittest object
MLE=Distributions()
#Detect outliers calling the DetectOutliers object
KStest=DistFittest()
outliers=HandleOutliers()
M1=KStest.ks_test(M1)
M1=outliers.DeleteExtremeOutliers(M1)
M2=KStest.ks_test(M2)
M2=outliers.DeleteExtremeOutliers(M2)
S1=MLE.Exponential_distrfit(S1)
S1=outliers.DeleteOutliers(S1)
#================================= Output preparation: output the updated values in the JSON file of this example =========================================================#
jsonFile=open('JSON_ConveyerLine.json','r')#It opens the JSON file
#Conduct distribution fitting calling the Distributions object and DistFittest object
data=json.load(jsonFile)#It loads the file
MLE=Distributions()
jsonFile.close()
KStest=DistFittest()
M1=KStest.ks_test(M1)
exportJSON=JSONOutput()
M2=KStest.ks_test(M2)
stationId1='M1'
S1=MLE.Exponential_distrfit(S1)
stationId2='M2'
#================================= Output preparation: output the updated values in the JSON file of this example =========================================================#
stationId3='S1'
ifnotjsonFile:
jsonFile=open(os.path.join(os.path.dirname(os.path.realpath(__file__)),JSONFileName),'r')#It opens the JSON file