Run a Notebook with Python Interpreter
To run Python commands in a notebook, you must first connect to the Python interpreter. To use OML4Py, you must import the oml
module.
In an Oracle Machine Learning notebook, you can add multiple paragraphs, and each paragraph can be connected to different interpreters such as SQL or Python. This example shows you how to:
- Connect to a Python interpreter to run Python commands in a notebook
- Import the Python modules -
oml
,matplotlib
, andnumpy
- Check if the
oml
module is connected to the Oracle Database
Note:
z
is a reserved keyword and must not be used as a variable in %python
paragraphs in Oracle Machine Learning Notebooks.
Assumption: The example assumes that you have created a new notebook named Py Note.
Example to demonstrate the use of the Python modules - matplotlib
and numpy
, and use random data to plot two histograms.
Parent topic: Edit Your Notebook