Use the Statistics commands in Python™ to view calculated statistics for a specific SPC or DMS retrieval. This allows you to view any statistic GainSeeker calculates and any custom statistics you have previously created. Access values in Pareto, OEE, or DPU Detail tables and view the raw data associated with a retrieval.
Also see Python command: Retrieval
See Python commands for other commands you can use with GainSeeker.
To access an SPC statistic, use statspc in the script
To access a DMS statistic, use statdms in the script
Syntax |
Example |
Description/Remarks |
New or changed in GainSeeker version |
(use code completion to choose a method) |
statspc.data.trace(1) statspc.data.eventspc() statspc.data.note() statdms.data.ncu() |
Gives access to the underlying data for a retrieval. All columns in an SPC or DMS data table are available. Calling a method under data returns the values for the associated data table column. Returns a list. |
8.8 8.9 |
[statspc/statdms].getstat(index) |
statspc.getstat(100) statdms.getstat(45) |
Returns an SPC or DMS statistic based on its index. For SPC: SPC statistics available For DMS: DMS statistics available |
|
[statspc/statdms].getstatstr(index) |
statspc.getstatstr(100) statdms.getstatstr(45) |
Returns the display string of an SPC or DMS statistic based on its index. For SPC: SPC statistics available For DMS: DMS statistics available |
|
[statspc/statdms].helpers.average(list) |
x = [4, 10, 8] statdms.helpers.average(x) |
Returns an average of the values. Returns None if a non-numeric, non-empty value is found. |
|
[statspc/statdms].helpers.count(list, value) |
x = [4, 10, 8, 4] statdms.helpers.count(x, 4) |
Returns the number of times a value appears in a list. Can be used with a mixture of text and numbers. |
|
[statspc/statdms].helpers.countregex(list, regex) |
x = ["goodbye", "8000", "good", "hello"] statdms.helpers.countregex(x, "\d+") |
Returns the number of elements in a list that match a regular expression. Can be used with a mixture of text and numbers. Quick reference for regular expressions (regex) |
|
[statspc/statdms].helpers.sum(list) |
x = [4, 10, 8] statdms.helpers.sum(x) |
Returns the sum of a list of numbers. Returns None if a non-numeric, non-empty value is found. |
|
[statspc/statdms].helpers.unique(list) |
x = [4, 10, 8, 4] statdms.helpers.unique(x) |
Returns the number of unique values are in a list. None is considered a unique value. |
|
Syntax |
Example |
Description/Remarks |
New or changed in GainSeeker version |
listRTFcodes = statspc.data.rtf() |
Returns a list containing one item for each row of data in the retrieval. Each item in the list is a number that represents all of the real-time failures (if any) that occurred in that row of data. For a reference of the failures represented by the returned number, see Real-time Failure codes. |
|
|
listRTFdescript = statspc.data.rtfstr() |
Returns a list containing one item for each row of data in the retrieval. Each item in the list is a list of all of the real-time failure descriptions (if any) that occurred in that row of data. (So this command actually returns a list of lists.) |
|
Syntax |
Example |
Description/Remarks |
New or changed in GainSeeker version |
statdms.dpu.method (use code completion to choose a method) |
statdms.dpu.dpm() statdms.dpu.sigma() |
Gives access to the DPU Detail table columns for a retrieval. Calling a method under dpu returns the values for the column that shares its name with the method. Returns a list. |
|
statdms.oee.method (use code completion to choose a method) |
statdms.oee.oeeavailability() statdms.oee.sumdowntime() |
Gives access to the OEE Detail table columns for a retrieval. Calling a method under oee returns the values for the column that shares its name with the method. Returns a list. |
|
statdms.pareto.method (use code completion to choose a method) |
statdms.pareto.ncucost() statdms.pareto.percenttotalcost() statdms.pareto.defectcost() |
Gives access to the Pareto Detail table columns for a retrieval. Calling a method under pareto returns the values for the column that shares its name with the method. Returns a list. |
|
This script retrieves and displays the Note values for one SPC standard and one DMS standard:
retrspc.partno =
"RH HEADLIGHT
01142 - 06B FLUSH"
list_notes = statspc.data.note()
for x in list_notes:
if x != None:
print x
retrdms.partno = "A-50
INSERT"
retrdms.process = "M-CUT
OFF"
list_dms_notes = statdms.data.note()
for x in list_dms_notes:
if x != None:
print x