Class DatasetUtilities
- java.lang.Object
- 
- com.inductiveautomation.ignition.common.script.builtin.DatasetUtilities
 
- 
 public class DatasetUtilities extends java.lang.Object
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classDatasetUtilities.PyDataSet
 - 
Constructor SummaryConstructors Constructor Description DatasetUtilities()
 - 
Method SummaryAll Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static DatasetaddColumn(Dataset ds, int colId, org.python.core.PySequence col, java.lang.String colName, org.python.core.PyType colType)static DatasetaddColumn(Dataset ds, org.python.core.PySequence col, java.lang.String colName, org.python.core.PyType colType)static DatasetaddRow(Dataset ds, int rowId, org.python.core.PySequence row)static DatasetaddRow(Dataset ds, org.python.core.PySequence row)static DatasetaddRows(Dataset ds, int rowId, org.python.core.PySequence[] rows)static DatasetaddRows(Dataset ds, org.python.core.PySequence[] rows)static DatasetappendDataset(Dataset ds1, Dataset ds2)static DatasetclearDataset(Dataset ds)static java.lang.StringdataSetToCSV(boolean headerRow, Dataset ds)Deprecated.static java.lang.StringdataSetToExcel(boolean headerRow, java.lang.Object[] datasets)static java.lang.StringdataSetToExcel(boolean headerRow, java.lang.Object[] datasets, boolean nullsEmpty)Deprecated.static byte[]dataSetToExcelBytes(boolean headerRow, java.lang.Object[] objects, boolean nullsEmpty, java.lang.String[] sheetNames)static voiddataSetToExcelStreaming(boolean headerRow, java.lang.Object[] objects, java.io.OutputStream out, boolean nullsEmpty)static voiddataSetToExcelStreaming(boolean headerRow, java.lang.Object[] datasets, java.io.Writer out, boolean nullsEmpty)Deprecated.static java.lang.StringdataSetToHTML(boolean headerRow, Dataset ds, java.lang.String title)static voiddataSetToHTMLStreaming(boolean headerRow, Dataset ds, java.lang.String title, java.io.Writer fw)static DatasetdeleteRow(Dataset ds, int row)static DatasetdeleteRows(Dataset ds, int[] rows)static DatasetfilterColumns(Dataset dataset, org.python.core.PySequence columns)static DatasetformatDates(Dataset dataset, java.lang.String format)static DatasetformatDates(Dataset dataset, java.lang.String format, java.util.Locale locale)Returns a new dataset with all date columns changed to Strings, and the dates formatted as stringsstatic DatasetfromCSV(java.lang.String csv)static DatasetfromCSVJava(java.lang.String csv)A special version of fromCSV that throws Java exceptions rather than wrapped, uncaught python exceptionsstatic org.python.core.PyListgetColumnHeaders(Dataset ds)static DatasetinsertColumn(Dataset ds, int colId, java.lang.Object[] col, java.lang.String colName, java.lang.Class colType)static DatasetinsertColumn(Dataset ds, int colId, org.python.core.PySequence col, java.lang.String colName, org.python.core.PyType colType)static DatasetinsertColumn(Dataset ds, org.python.core.PySequence row, java.lang.String colName, org.python.core.PyType colType)static DatasetinsertRow(Dataset ds, int rowId, org.python.core.PySequence row)static DatasetinsertRow(Dataset ds, org.python.core.PySequence row)static DatasetremoveRow(Dataset ds, int row)static DatasetsetValue(Dataset ds, int row, int col, java.lang.Object value)static DatasetsetValue(Dataset ds, int row, int col, org.python.core.PyObject value)static DatasetsetValue(Dataset ds, int row, java.lang.String col, org.python.core.PyObject value)static Datasetsort(Dataset dataset, int keyColumn)static Datasetsort(Dataset dataset, int keyColumn, boolean ascending)static Datasetsort(Dataset dataset, int keyColumn, boolean ascending, boolean naturalOrdering)static Datasetsort(Dataset dataset, java.lang.String keyColumn)static Datasetsort(Dataset dataset, java.lang.String keyColumn, boolean ascending)static Datasetsort(Dataset dataset, java.lang.String keyColumn, boolean ascending, boolean naturalOrdering)static java.lang.StringtoCSV(org.python.core.PyObject[] pyArgs, java.lang.String[] keywords)static java.lang.StringtoCSVJava(Dataset ds, boolean showHeaders, boolean forExport)static java.lang.StringtoCSVJava(Dataset ds, boolean showHeaders, boolean forExport, boolean localized)static voidtoCSVJavaStreaming(Dataset ds, java.lang.Boolean showHeaders, boolean forExport, java.io.Writer sw, boolean localized)static DatasettoDataSet(DatasetUtilities.PyDataSet pds)static DatasettoDataSet(org.python.core.PySequence headers, org.python.core.PySequence pyData)static byte[]toExcel(org.python.core.PyObject[] pyArgs, java.lang.String[] keywords)Exports 1 or moreDatasets to excel.static JSONObjecttoJSONObject(Dataset data)Returns a JSON object in the format of:static DatasetUtilities.PyDataSettoPyDataSet(Dataset dataset)static DatasetupdateRow(Dataset ds, int row, org.python.core.PyDictionary changes)
 
- 
- 
- 
Method Detail- 
sortpublic static Dataset sort(Dataset dataset, java.lang.String keyColumn, boolean ascending, boolean naturalOrdering) 
 - 
sortpublic static Dataset sort(Dataset dataset, int keyColumn, boolean ascending, boolean naturalOrdering) 
 - 
formatDatespublic static Dataset formatDates(Dataset dataset, java.lang.String format) throws java.lang.IllegalArgumentException - Throws:
- java.lang.IllegalArgumentException
 
 - 
formatDatespublic static Dataset formatDates(Dataset dataset, java.lang.String format, java.util.Locale locale) throws java.lang.IllegalArgumentException Returns a new dataset with all date columns changed to Strings, and the dates formatted as strings- Parameters:
- dataset- Dataset to format
- format- Date format to use
- locale- Locale to use. If null, default will be used.
- Returns:
- New dataset, formatted. If there are no date columns, original dataset is returned.
- Throws:
- java.lang.IllegalArgumentException- is date format is not valid
 
 - 
toPyDataSetpublic static DatasetUtilities.PyDataSet toPyDataSet(Dataset dataset) 
 - 
toDataSetpublic static Dataset toDataSet(DatasetUtilities.PyDataSet pds) 
 - 
toDataSetpublic static Dataset toDataSet(org.python.core.PySequence headers, org.python.core.PySequence pyData) 
 - 
filterColumnspublic static Dataset filterColumns(Dataset dataset, org.python.core.PySequence columns) throws java.lang.Exception - Throws:
- java.lang.Exception
 
 - 
fromCSVpublic static Dataset fromCSV(java.lang.String csv) 
 - 
fromCSVJavapublic static Dataset fromCSVJava(java.lang.String csv) throws java.io.IOException, java.lang.ClassNotFoundException, java.lang.IllegalArgumentException A special version of fromCSV that throws Java exceptions rather than wrapped, uncaught python exceptions- Throws:
- java.io.IOException
- java.lang.ClassNotFoundException
- java.lang.IllegalArgumentException
 
 - 
toCSVpublic static java.lang.String toCSV(org.python.core.PyObject[] pyArgs, java.lang.String[] keywords)
 - 
toCSVJavapublic static java.lang.String toCSVJava(Dataset ds, boolean showHeaders, boolean forExport) 
 - 
toCSVJavapublic static java.lang.String toCSVJava(Dataset ds, boolean showHeaders, boolean forExport, boolean localized) 
 - 
toCSVJavaStreamingpublic static void toCSVJavaStreaming(Dataset ds, java.lang.Boolean showHeaders, boolean forExport, java.io.Writer sw, boolean localized) 
 - 
toJSONObjectpublic static JSONObject toJSONObject(Dataset data) Returns a JSON object in the format of:{ "columns": [ { "name": "col_1", "type": "java.lang.Integer" }, { "name": "col_2", "type": "java.lang.Integer" }, { "name": "col_3", "type": "java.lang.Integer" }], "rows": [ [ 1, 2, "hello" ], [ 3, 8, "whatever" ]] }
 - 
dataSetToCSV@Deprecated public static java.lang.String dataSetToCSV(boolean headerRow, Dataset ds)Deprecated.
 - 
dataSetToHTMLpublic static java.lang.String dataSetToHTML(boolean headerRow, Dataset ds, java.lang.String title)
 - 
dataSetToHTMLStreamingpublic static void dataSetToHTMLStreaming(boolean headerRow, Dataset ds, java.lang.String title, java.io.Writer fw) throws java.io.IOException- Throws:
- java.io.IOException
 
 - 
dataSetToExcel@Deprecated public static java.lang.String dataSetToExcel(boolean headerRow, java.lang.Object[] datasets, boolean nullsEmpty)Deprecated.Exports 1 or more datasets to excel.- Parameters:
- datasets- An array of Datasets or PyDataSets. Each dataset will be on a separate sheet.
 
 - 
dataSetToExcelpublic static java.lang.String dataSetToExcel(boolean headerRow, java.lang.Object[] datasets)
 - 
toExcelpublic static byte[] toExcel(org.python.core.PyObject[] pyArgs, java.lang.String[] keywords) throws java.io.IOExceptionExports 1 or moreDatasets to excel.- Throws:
- java.io.IOException
 
 - 
dataSetToExcelStreaming@Deprecated public static void dataSetToExcelStreaming(boolean headerRow, java.lang.Object[] datasets, java.io.Writer out, boolean nullsEmpty) throws java.io.IOExceptionDeprecated.- Throws:
- java.io.IOException
 
 - 
dataSetToExcelStreamingpublic static void dataSetToExcelStreaming(boolean headerRow, java.lang.Object[] objects, java.io.OutputStream out, boolean nullsEmpty)
 - 
dataSetToExcelBytespublic static byte[] dataSetToExcelBytes(boolean headerRow, java.lang.Object[] objects, boolean nullsEmpty, @Nullable java.lang.String[] sheetNames)
 - 
addRowpublic static Dataset addRow(Dataset ds, org.python.core.PySequence row) throws org.python.core.PyException - Throws:
- org.python.core.PyException
 
 - 
addRowpublic static Dataset addRow(Dataset ds, int rowId, org.python.core.PySequence row) throws org.python.core.PyException - Throws:
- org.python.core.PyException
 
 - 
insertRowpublic static Dataset insertRow(Dataset ds, org.python.core.PySequence row) throws org.python.core.PyException - Throws:
- org.python.core.PyException
 
 - 
insertRowpublic static Dataset insertRow(Dataset ds, int rowId, org.python.core.PySequence row) throws org.python.core.PyException - Throws:
- org.python.core.PyException
 
 - 
addRowspublic static Dataset addRows(Dataset ds, org.python.core.PySequence[] rows) throws org.python.core.PyException - Throws:
- org.python.core.PyException
 
 - 
addRowspublic static Dataset addRows(Dataset ds, int rowId, org.python.core.PySequence[] rows) throws org.python.core.PyException - Throws:
- org.python.core.PyException
 
 - 
appendDatasetpublic static Dataset appendDataset(Dataset ds1, Dataset ds2) throws org.python.core.PyException - Throws:
- org.python.core.PyException
 
 - 
addColumnpublic static Dataset addColumn(Dataset ds, org.python.core.PySequence col, java.lang.String colName, org.python.core.PyType colType) throws org.python.core.PyException - Throws:
- org.python.core.PyException
 
 - 
addColumnpublic static Dataset addColumn(Dataset ds, int colId, org.python.core.PySequence col, java.lang.String colName, org.python.core.PyType colType) throws org.python.core.PyException - Throws:
- org.python.core.PyException
 
 - 
insertColumnpublic static Dataset insertColumn(Dataset ds, org.python.core.PySequence row, java.lang.String colName, org.python.core.PyType colType) throws org.python.core.PyException - Throws:
- org.python.core.PyException
 
 - 
insertColumnpublic static Dataset insertColumn(Dataset ds, int colId, org.python.core.PySequence col, java.lang.String colName, org.python.core.PyType colType) throws org.python.core.PyException - Throws:
- org.python.core.PyException
 
 - 
insertColumnpublic static Dataset insertColumn(Dataset ds, int colId, java.lang.Object[] col, java.lang.String colName, java.lang.Class colType) throws org.python.core.PyException - Throws:
- org.python.core.PyException
 
 - 
getColumnHeaderspublic static org.python.core.PyList getColumnHeaders(Dataset ds) throws org.python.core.PyException - Throws:
- org.python.core.PyException
 
 - 
removeRowpublic static Dataset removeRow(Dataset ds, int row) throws org.python.core.PyException - Throws:
- org.python.core.PyException
 
 - 
deleteRowpublic static Dataset deleteRow(Dataset ds, int row) throws org.python.core.PyException - Throws:
- org.python.core.PyException
 
 - 
deleteRowspublic static Dataset deleteRows(Dataset ds, int[] rows) throws org.python.core.PyException - Throws:
- org.python.core.PyException
 
 - 
updateRowpublic static Dataset updateRow(Dataset ds, int row, org.python.core.PyDictionary changes) throws org.python.core.PyException - Throws:
- org.python.core.PyException
 
 - 
setValuepublic static Dataset setValue(Dataset ds, int row, java.lang.String col, org.python.core.PyObject value) throws org.python.core.PyException - Throws:
- org.python.core.PyException
 
 - 
setValuepublic static Dataset setValue(Dataset ds, int row, int col, org.python.core.PyObject value) throws org.python.core.PyException - Throws:
- org.python.core.PyException
 
 
- 
 
-