To write your custom code using RubiNotebook, follow the steps given below.
Note: | The features in the above table can be used while running the entire node only. These features cannot be used while running individual cells of the Python program in the RubiNotebook editor. |
The fields/icons on the RubiNotebook code editor are described in the table below.
Field | Description |
File | It allows you to download python file (.py), python notebook (.ipynb), html file (.html), upload files, objects and notebooks |
It helps you to Insert a new cell below the selected cell. | |
| It helps you to Cut the selected cell. |
It helps you to Copy the selected cell. | |
It helps you to Paste the copied or cut cell into the selected cell. | |
It helps you to execute the Python program. | |
It helps you to interrupt the kernel. The kernel resumes work when you start the execution of the program again. | |
It helps you to restart the kernel when it is shut down. | |
It helps you to restart the kernel and re-run the notebook. | |
Code cells– it allows you to write and edit new codes. Markdown- It allows you to format a text. It also documents the computational process in a literal way. Raw cells – It provides a place where we can write output directly. |
After completing, click Close to close the RubiNotebook page and return to the workbook page.
Notes: |
|
Consider the following code.
Code | Description |
getRPredTaskResults() | It reads the data from the predecessor nodes. |
rReturn() | It stores the metadata and results of RubiNotebook tasks (Current task). |
Code | Description |
_predecessorName_R_ | It displays the predecessor name connected to the RubiNotebook. |
data = getRPredTaskResults(taskId_R=_predecessorName_R_['Female_Birth']) | Enter the task name to access the predecessor. |
data | Prints the data as data dictionary. |
import pandas as pd | Prompt to display the data in data frame |
new = pd.DataFrame.from_dict(data) | We save the framed data as new. |
new | Prints new result. |
returnData = getRPredTaskResults(taskId_R=_predecessorName_R_['Female_Birth']) | It stores the metadata and results of RubiNotebook tasks. |
Click on the Save button.
|
|
You can use the output from the RubiNotebook for the successor tasks using functions.
The Figure below shows the RubiNotebook node and its successor, the RubiPython node.
The figure given below shows the data in RubiNotebook. It contains data about City and Temperature.
Code | Description |
df = inputData[‘RubiNotebook’] | It access the data from RubiNotebook and stores in the df. |
Output | It creates an empty dictionary |
Output[‘Category1’]= df[‘Category’] | It maps the custom output to the column Category from RubiNotebook |
Output[‘Discount1’]= df[‘Discount’] | It maps the custom output to the column Discount from RubiNotebook |
Output[‘Country1’]= df[‘Country’] | It maps the custom output to the column Country from RubiNotebook |
return | It returns the output |