SAP Home Learn Build Integrate Model Operate Extend with AI ConnectTutorial navigator Knowledge Graph API Devtoberfest Developer Advocates App Space

Manage my Account SAP Devs YouTube ↗ Learnings ↗ Community ↗ Provide Feedback ↗
Logout
โคข Open full site

Visualize Spatial Data in SAP HANA Cloud Using Jupyter Notebook

Connect your Python script from Jupyter Notebook to SAP HANA Cloud, SAP HANA database, creating a visualization of spatial data in SAP HANA Cloud.

Overview

🎓 beginner 15 min. SAP HANA CloudBeginnerSAP HANA CloudSAP HANA DatabaseSAP HANA SpatialSAP HANA Multi Model ProcessingSAP HANA Graph

You will learn

  • โœ”How to create a connection between Jupyter Notebook and database instance
  • โœ”How to load CSV data into pandas data-frame
  • โœ”How to create a table in database instance from pandas data-frame
  • โœ”How to create data visualizations in SAP HANA Cloud, SAP HANA database
Unknown U Unknown November 1, 2022
Created by July 30, 2021
Contributors

Prerequisites

Prerequisites

  • Make sure that you have a running SAP HANA database instance in SAP HANA Cloud.
  • Download the sample data “travelroute.zip” file from GitHub repository

Steps

Intro

There are many data driven applications that can be developed by using the SAP HANA database instance in SAP HANA Cloud with any other development environment, such as Jupyter Notebook.

In this example, we’ll focus on creating a Python 3 file on Jupyter Notebook and connect it to our database instance. Once the connection is created, then we can add data to the instance or access data stored in the instance.

By connecting Python files to your database instance, it also possible to use machine learning capabilities.


Step 1 Setup the environment for connection
โ€”

Before you get started, make sure you have Anaconda installed on your system. You can install Anaconda from here.

You can also use Jupyter Notebook from Visual Studio. If you prefer to use Visual Studio with Anaconda, you can install Visual Studio Code from here.

To work with Jupyter Notebook, you must activate an Anaconda environment in VS Code. To select an environment, use the Python Select Interpreter command from the Command Palette (Ctrl+Shift+P). Once the appropriate environment is activated, you can create and open a Jupyter Notebook.

In this tutorial, you will see an example of Jupyter Notebook from Anaconda.

Step 2 Install packages
+
Step 3 Import packages for creating a connection
+
Step 4 Load data from a csv into a pandas data-frame
+
Step 5 Create a database table from pandas data-frame
+
Step 6 Access the table from Jupyter Notebook
+
Step 7 Test yourself
+

Resources

Discussion

Share feedback on this tutorial or join the conversation in SAP Community.

Submit detailed feedback Discuss in Community
Steps
Step 1 of 7
1. Setup the environment for connection 2. Install packages 3. Import packages for creating a connection 4. Load data from a csv into a pandas data-frame 5. Create a database table from pandas data-frame 6. Access the table from Jupyter Notebook 7. Test yourself

Learn more →