Page History
Sv translation | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
To be able to work with data in a ML Project, they first need to be loaded. Data can be loaded from a CSV file, XLS file, database, data set or a temporary table. There two ways how to read data in BellaDati ML Studio - row by row or as an stream. Reading Row by rowWhen reading data row by row, the content of the cycle (closure) is executed for each row of of the file. For each row (cycle), these variables are set:
Reading from CSV FileFunction readCSVFile() is used for loading data from a CSV file. The function is defined like this:
ParametersParameters file and separator are mandatory, parameters escape, limit and closure are optional.
Sample usage
This code will print the row index and value of second column for first 10 rows of the file to the console. After finishing the loop it will display the total number of iterations, in this case 10. Reading from XLS FileFunction readXLSFile() is used for loading data from XLS file. The function is defined like this:
ParametersParameters file is mandatory, parameters limit and closure are optional.
Sample usage
This code will print the row index and value of second column for first 5 rows of the file to the console. After finishing the loop it will display the total number of iterations, in this case 5. Reading from SQL DatabaseFunction readSQL is used for loading data from an SQL database. This function uses SQL connections which were previously defined in BellaDati. See Data Sources for more information. The function is defined like this:
ParametersParameters id and sql are mandatory, parameters limit and closure are optional.
Sample usage
This code will use database connection with ID 1 and it will load all columns for 10 rows from table customers. Reading from Data SetFunction readDataset() is used for loading data from a data set. The function is defined like this:
ParametersParameter id is mandatory, parameters limit and closure are optional.
Sample usage
This code will use data set with ID 10 and it will load name and value of first column for 5 rows. Reading from TableFunction table() can be used for loading data from a temporary table which was previously stored in the project. The table is available for current session only. The function is defined like this:
ParametersParameters id is mandatory, parameter closure is optional.
Sample usage
This code will print value of first column for each row of the table to the console. Reading as a Stream
When reading data as a stream, the rows are not iterated, but instead sent all at once as na input stream. In most cases, it is better to use reading row by row. We suggest using streams only when necessary, for example with some Python scripts. Streaming from CSV fileFunction streamCSVFile() is used for streaming data from a CSV file. The function is defined like this:
ParametersParameters file and separator are mandatory, parameters escape and limit are optional.
Sample usage
This code will print the all values from the file, separated by a comma. Streaming from XLS fileFunction streamXLSFile() is used for streaming data from a XLS file. The function is defined like this:
ParametersParameters file is mandatory, parameter limit is optional.
Sample usage
This code will print first five rows from the file, with values separated by a comma. Streaming from SQL databaseFunction streamXLSFile() is used for streaming data from a XLS file. The function is defined like this:
ParametersParameters id id mandatory.
Sample usage
This code will print first five rows from the table, with values separated by a comma. Streaming from Data setFunction streamDataset() is used for streaming data from a data set. The function is defined like this:
ParametersParameters id is mandatory.
Sample usage
This code will print all rows from the data set. Streaming from TableFunction streamTable() can be used for streaming data from a temporary table which was previously stored in the project. The table is available for current session only. The function is defined like this:
ParametersParameters id is mandatory.
Sample usage
This code will print all rows from the table. |
Sv translation | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
To be able to work with data in a ML Project, they first need to be loaded. Data can be loaded from a CSV file, XLS file, database, data set or a temporary table. There two ways how to read data in BellaDati ML Studio - row by row or as an stream. Reading Row by rowWhen reading data row by row, the content of the cycle (closure) is executed for each row of of the file. For each row (cycle), these variables are set:
Reading from CSV FileFunction readCSVFile() is used for loading data from a CSV file. The function is defined like this:
ParametersParameters file and separator are mandatory, parameters escape, limit and closure are optional.
Sample usage
This code will print the row index and value of second column for first 10 rows of the file to the console. After finishing the loop it will display the total number of iterations, in this case 10. Reading from XLS FileFunction readXLSFile() is used for loading data from XLS file. The function is defined like this:
ParametersParameters file is mandatory, parameters limit and closure are optional.
Sample usage
This code will print the row index and value of second column for first 5 rows of the file to the console. After finishing the loop it will display the total number of iterations, in this case 5. Reading from SQL DatabaseFunction readSQL is used for loading data from an SQL database. This function uses SQL connections which were previously defined in BellaDati. See Data Sources for more information. The function is defined like this:
ParametersParameters id and sql are mandatory, parameters limit and closure are optional.
Sample usage
This code will use database connection with ID 1 and it will load all columns for 10 rows from table customers. Reading from Data SetFunction readDataset() is used for loading data from a data set. The function is defined like this:
ParametersParameter id is mandatory, parameters limit and closure are optional.
Sample usage
This code will use data set with ID 10 and it will load name and value of first column for 5 rows. Reading from TableFunction table() can be used for loading data from a temporary table which was previously stored in the project. The table is available for current session only. The function is defined like this:
ParametersParameters id is mandatory, parameter closure is optional.
Sample usage
This code will print value of first column for each row of the table to the console. Reading as a Stream
When reading data as a stream, the rows are not iterated, but instead sent all at once as na input stream. In most cases, it is better to use reading row by row. We suggest using streams only when necessary, for example with some Python scripts. Streaming from CSV fileFunction streamCSVFile() is used for streaming data from a CSV file. The function is defined like this:
ParametersParameters file and separator are mandatory, parameters escape and limit are optional.
Sample usage
This code will print the all values from the file, separated by a comma. Streaming from XLS fileFunction streamXLSFile() is used for streaming data from a XLS file. The function is defined like this:
ParametersParameters file is mandatory, parameter limit is optional.
Sample usage
This code will print first five rows from the file, with values separated by a comma. Streaming from SQL databaseFunction streamXLSFile() is used for streaming data from a XLS file. The function is defined like this:
ParametersParameters id id mandatory.
Sample usage
This code will print first five rows from the table, with values separated by a comma. Streaming from Data setFunction streamDataset() is used for streaming data from a data set. The function is defined like this:
ParametersParameters id is mandatory.
Sample usage
This code will print all rows from the data set. Streaming from TableFunction streamTable() can be used for streaming data from a temporary table which was previously stored in the project. The table is available for current session only. The function is defined like this:
ParametersParameters id is mandatory.
Sample usage
This code will print all rows from the table. |