Skip to main content

Analysis Notebooks

Analysis notebooks offer a scratch space for analyzing data in Ganymede Cloud. To access a fresh notebook instance, go to the

Flow Editor
page, click on the Analysis button in the header and select default. The image below shows an example of what this notebook could contain:

Ganymede Notebook

creating additional notebooks

To create additional notebooks, duplicate the notebook that you are in by pressing Alt+N in Windows/Linux or Option+N in MacOS.

Installing Python packages

A list of available packages can be retrieved by running

!pip freeze --local

Additional packages can be installed using pip magic. For example, the following command installs a number of analytics and plotting packages:

!pip install scikit-learn seaborn matplotlib pandas_gbq

Loading data from Ganymede data lake

Tables in the environment can be accessed via the Ganymede SDK. For example, the code below lists available tables:

from ganymede_sdk import Ganymede

g = Ganymede()
tables = g.list_tables()
for table in tables:
print(table.table_id)

To run a query, pass an ANSI SQL snippet to the query_sql variable and use the retrieve_sql method from Ganymede's query module. This will return the results as a Pandas DataFrame. Below is an example of retrieving query results.

q = 'select * from ganymede_demo.demo_table'
from ganymede_sdk import Ganymede

g.retrieve_sql(query_sql)