- 23 Dec 2022
- 1 Minute to read
- Print
- DarkLight
Script
- Updated on 23 Dec 2022
- 1 Minute to read
- Print
- DarkLight
Documentation
Examples
Create a new source dataframe in Python
Use the script node to create a source data frame.
Add an additional row to the data frame in the default Python source script.
The initial source data frame is represented in Python as the list:
[{'account': 'Jones LLC', 'Jan': 150, 'Feb': 200, 'Mar': 140}, {'account': 'Alpha Co', 'Jan': 200, 'Feb': 210, 'Mar': 215}, {'account': 'Blue Inc', 'Jan': 50, 'Feb': 90, 'Mar': 95 }]
In order to add a row, change the above to:
[{'account': 'Jones LLC', 'Jan': 150, 'Feb': 200, 'Mar': 140}, {'account': 'Alpha Co', 'Jan': 200, 'Feb': 210, 'Mar': 215}, {'account': 'Blue Inc', 'Jan': 50, 'Feb': 90, 'Mar': 95 }, {'account': 'ABC', 'Jan': 250, 'Feb': 250, 'Mar': 340}]
This will add a row to the bottom of the data frame. The node is now ready to be connected to another node.