################### Import data using the ImportCSVdataobject ###################################
filename1=("DataSet.csv")
filename2=("InterArrivalData.csv")
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
procData=CSV.Input_data(filename1)
sourceData=CSV.Input_data(filename2)
M1=procData.get('M1',[])#get from the returned Python dictionary the data sets
M2=procData.get('M2',[])
S1=sourceData.get('S1',[])
################### Processing of the data sets calling the following objects ###################################
#Replace missing values calling the corresponding object
missingValues=HandleMissingValues()
M1=missingValues.DeleteMissingValue(M1)
M2=missingValues.DeleteMissingValue(M2)
S1=missingValues.ReplaceWithMean(S1)
#Detect outliers calling the DetectOutliers object
outliers=HandleOutliers()
M1=outliers.DeleteExtremeOutliers(M1)
M2=outliers.DeleteExtremeOutliers(M2)
S1=outliers.DeleteOutliers(S1)
#Conduct distribution fitting calling the Distributions object and DistFittest object
MLE=Distributions()
KStest=DistFittest()
M1=KStest.ks_test(M1)
M2=KStest.ks_test(M2)
S1=MLE.Exponential_distrfit(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
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
procData=CSV.Input_data(CSVFileName2)
sourceData=CSV.Input_data(CSVFileName1)
M1=procData.get('M1',[])#get from the returned Python dictionary the data sets
M2=procData.get('M2',[])
S1=sourceData.get('S1',[])
################### Processing of the data sets calling the following objects ###################################
#Replace missing values calling the corresponding object
missingValues=HandleMissingValues()
M1=missingValues.DeleteMissingValue(M1)
M2=missingValues.DeleteMissingValue(M2)
S1=missingValues.ReplaceWithMean(S1)
#Detect outliers calling the DetectOutliers object
outliers=HandleOutliers()
M1=outliers.DeleteExtremeOutliers(M1)
M2=outliers.DeleteExtremeOutliers(M2)
S1=outliers.DeleteOutliers(S1)
#Conduct distribution fitting calling the Distributions object and DistFittest object
MLE=Distributions()
KStest=DistFittest()
M1=KStest.ks_test(M1)
M2=KStest.ks_test(M2)
S1=MLE.Exponential_distrfit(S1)
#================================= Output preparation: output the updated values in the JSON file of this example =========================================================#
ifnotjsonFile:
jsonFile=open(os.path.join(os.path.dirname(os.path.realpath(__file__)),JSONFileName),'r')#It opens the JSON file