"where" brainscript functionality in Python
Hello,
I am still in the process of transitioning my brain from brainscript to Python. In brainscript, I used the Transform node the most and took advantage of the "where" functionality to restrict the output based on some calculation. Today, I find myself setting up the calculation in a Transform node, outputting a "flag" column, and then filtering out the un-wanted output in a Filter node based on that "flag". It seems not very efficient so I wanted to reach out and ask if there is a better way to program the "where" using Python into the Transform node.
Thanks!
Rodi
-
You will also need to ensure that the condition also handles Null values.
There are some other examples of filtering shown in the default ProcessRecords script displayed when the Transform node is added to the canvas. Also see the examples shown in the Transform node online help, which show the effect of setting the output record to None and the use of the implicit write mode.
You may also be interested in the Migrating to Dataverse guide which covers scripting and other differences between Dataverse and the Lavastorm LAE product:
https://installers.lavastorm.com/Dataverse320/Migrating+to+Dataverse.pdf
In addition, a useful way understanding the Python code is to look at the automatically generated code in the Advanced tab of the Filter node once some filter criteria have been specified using the filter grid editor.Regards,
Adrian
-
The is also a Dataverse Python module some 'Null safe' functions available for comparisons and string manipulation, see the help in this topic: Python scripting > Python module support
The topic is also available online here:
https://d3sa-preview.infogixsaas.com/docs/dist/help/Default.htm#f-script/python/python-modules.htm
Please sign in to leave a comment.
Comments
3 comments