A resource file is a file that contains the resources that you use in the Python code. If you use a pre-trained model, you specify the pre-trained model as a resource file in the Python transformation.
In the Python transformation, list the resource file path on the Data Integration Service machine. Separate multiple resource file paths using a comma.
When you access the resource file in the Python code, you reference the list
resourceJepFile
. To reference the list, you must specify a resource file in the Python transformation. When you reference the list, you specify an index to locate the resource file according to the order that the resource file appears in the Python transformation.
For example, you specify several resource files in the Python transformation. To reference the first resource file in the Python code, you can use the variable
resourceJepFile[0]
.
The following image shows how you can specify a resource file in the Python transformation and access the resource file in the Python code:
The resource files
foxgloveDataMLmodel.pkl
and
irisDataMLmodel.pkl
are listed using the resource file paths on the Data Integration Service machine. The Python code accesses the resource files to reconstruct the respective Python objects. To access the first resource file, the Python code references the resource file using
resourceJepFile[0]
. To access the second resource file
irisDataMLmodel.pkl
, the Python code references the resource file using