# Data load support #

You can add automatically generated code to load data from project data assets to a notebook cell\. The asset type can be a file or a database connection\.

By clicking in an empty code cell in your notebook, clicking the **Code snippets** icon (![the Code snippets icon](https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/images/code-snippets-icon.png)) from the notebook toolbar, selecting **Read data** and an asset from the project, you can:

<!-- <ul> -->

 *  Insert the data source access credentials\. This capability is available for all data assets that are added to a project\. With the credentials, you can write your own code to access the asset and load the data into data structures of your choice\.
 *  Generate code that is added to the notebook cell\. The inserted code serves as a quick start to allow you to easily begin working with a data set or connection\. For production systems, you should carefully review the inserted code to determine if you should write your own code that better meets your needs\.
    
    When you run the code cell, the data is accessed and loaded into the data structure you selected.
    
    **Notes**:
    
    <!-- <ol> -->
    
    1.  The ability to provide generated code is disabled for some connections if:
        
        <!-- <ul> -->
        
         *  The connection credentials are personal credentials
         *  The connection uses a secure gateway link
         *  The connection credentials are stored in vaults
        
        <!-- </ul> -->
        
    2.  If the file type or database connection that you are using doesn't appear in the following lists, you can select to create generic code. For Python this is a StreamingBody object and for R a textConnection object.
    
    <!-- </ol> -->
    
<!-- </ul> -->

The following tables show you which data source connections (file types and database connections) support the option to generate code\. The options for generating code vary depending on the data source, the notebook coding language, and the notebook runtime compute\.

## Supported files types ##

<!-- <table> -->

Table 1\. Supported file types

| Data source              | Notebook coding language | Compute engine type          | Available support to load data                                    |
| ------------------------ | ------------------------ | ---------------------------- | ----------------------------------------------------------------- |
| CSV files                |                          |
|                          | Python                   | Anaconda Python distribution | Load data into pandasDataFrame                                    |
|                          |                          | With Spark                   | Load data into pandasDataFrame and sparkSessionDataFrame          |
|                          |                          | With Hadoop                  | Load data into pandasDataFrame and sparkSessionDataFrame          |
|                          | R                        | Anaconda R distribution      | Load data into R data frame                                       |
|                          |                          | With Spark                   | Load data into R data frame and sparkSessionDataFrame             |
|                          |                          | With Hadoop                  | Load data into R data frame and sparkSessionDataFrame             |
| Python Script            |                          |
|                          | Python                   | Anaconda Python distribution | Load data into pandasStreamingBody                                |
|                          |                          | With Spark                   | Load data into pandasStreamingBody                                |
|                          |                          | With Hadoop                  | Load data into pandasStreamingBody                                |
|                          | R                        | Anaconda R distribution      | Load data into rRawObject                                         |
|                          |                          | With Spark                   | Load data into rRawObject                                         |
|                          |                          | With Hadoop                  | Load data into rRawObject                                         |
| JSON files               |                          |
|                          | Python                   | Anaconda Python distribution | Load data into pandasDataFrame                                    |
|                          |                          | With Spark                   | Load data into pandasDataFrame and sparkSessionDataFrame          |
|                          |                          | With Hadoop                  | Load data into pandasDataFrame and sparkSessionDataFrame          |
|                          | R                        | Anaconda R distribution      | Load data into R data frame                                       |
|                          |                          | With Spark                   | Load data into R data frame, rRawObject and sparkSessionDataFrame |
|                          |                          | With Hadoop                  | Load data into R data frame, rRawObject and sparkSessionDataFrame |
| \.xlsx and \.xls files   |                          |
|                          | Python                   | Anaconda Python distribution | Load data into pandasDataFrame                                    |
|                          |                          | With Spark                   | Load data into pandasDataFrame                                    |
|                          |                          | With Hadoop                  | Load data into pandasDataFrame                                    |
|                          | R                        | Anaconda R distribution      | Load data into rRawObject                                         |
|                          |                          | With Spark                   | No data load support                                              |
|                          |                          | With Hadoop                  | No data load support                                              |
| Octet\-stream file types |                          |
|                          | Python                   | Anaconda Python distribution | Load data into pandasStreamingBody                                |
|                          |                          | With Spark                   | Load data into pandasStreamingBody                                |
|                          | R                        | Anaconda R distribution      | Load data in rRawObject                                           |
|                          |                          | With Spark                   | Load data in rDataObject                                          |
| PDF file type            |                          |
|                          | Python                   | Anaconda Python distribution | Load data into pandasStreamingBody                                |
|                          |                          | With Spark                   | Load data into pandasStreamingBody                                |
|                          |                          | With Hadoop                  | Load data into pandasStreamingBody                                |
|                          | R                        | Anaconda R distribution      | Load data in rRawObject                                           |
|                          |                          | With Spark                   | Load data in rDataObject                                          |
|                          |                          | With Hadoop                  | Load data into rRawData                                           |
| ZIP file type            |                          |
|                          | Python                   | Anaconda Python distribution | Load data into pandasStreamingBody                                |
|                          |                          | With Spark                   | Load data into pandasStreamingBody                                |
|                          | R                        | Anaconda R distribution      | Load data in rRawObject                                           |
|                          |                          | With Spark                   | Load data in rDataObject                                          |
| JPEG, PNG image files    |                          |
|                          | Python                   | Anaconda Python distribution | Load data into pandasStreamingBody                                |
|                          |                          | With Spark                   | Load data into pandasStreamingBody                                |
|                          |                          | With Hadoop                  | Load data into pandasStreamingBody                                |
|                          | R                        | Anaconda R distribution      | Load data in rRawObject                                           |
|                          |                          | With Spark                   | Load data in rDataObject                                          |
|                          |                          | With Hadoop                  | Load data in rDataObject                                          |
| Binary files             |                          |
|                          | Python                   | Anaconda Python distribution | Load data into pandasStreamingBody                                |
|                          |                          | With Spark                   | Load data into pandasStreamingBody                                |
|                          |                          | Hadoop                       | No data load support                                              |
|                          | R                        | Anaconda R distribution      | Load data in rRawObject                                           |
|                          |                          | With Spark                   | Load data into rRawObject                                         |
|                          |                          | Hadoop                       | Load data in rDataObject                                          |

<!-- </table ""> -->

## Supported database connections ##

<!-- <table> -->

Table 2\. Supported database connections

| Data source                                                                                                                                                                              | Notebook coding language | Compute engine type          | Available support to load data                                                                                                                                                                                                                                                                                                                  |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------ | ---------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| \- [Db2 Warehouse on Cloud](https://dataplatform.cloud.ibm.com/docs/content/wsj/manage-data/conn-db2-wh.html)  <br>\- [IBM Db2 on Cloud](https://dataplatform.cloud.ibm.com/docs/content/wsj/manage-data/conn-db2-cloud.html)  <br>\- [IBM Db2 Database](https://dataplatform.cloud.ibm.com/docs/content/wsj/manage-data/conn-db2.html)                                                                                                  |                          |
|                                                                                                                                                                                          | Python                   | Anaconda Python distribution | Load data into ibmdbpyIda and ibmdbpyPandas                                                                                                                                                                                                                                                                                                     |
|                                                                                                                                                                                          |                          | With Spark                   | Load data into ibmdbpyIda, ibmdbpyPandas and sparkSessionDataFrame                                                                                                                                                                                                                                                                              |
|                                                                                                                                                                                          |                          | With Hadoop                  | Load data into ibmdbpyIda, ibmdbpyPandas and sparkSessionDataFrame                                                                                                                                                                                                                                                                              |
|                                                                                                                                                                                          | R                        | Anaconda R distribution      | Load data into ibmdbrIda and ibmdbrDataframe                                                                                                                                                                                                                                                                                                    |
|                                                                                                                                                                                          |                          | With Spark                   | Load data into ibmdbrIda, ibmdbrDataFrame and sparkSessionDataFrame                                                                                                                                                                                                                                                                             |
|                                                                                                                                                                                          |                          | With Hadoop                  | Load data into ibmdbrIda, ibmdbrDataFrame and sparkSessionDataFrame                                                                                                                                                                                                                                                                             |
| \- [Db2 for z/OS](https://dataplatform.cloud.ibm.com/docs/content/wsj/manage-data/conn-db2-wh.html)  <br>                                                                                                                                          |                          |
|                                                                                                                                                                                          | Python                   | Anaconda Python distribution | Load data into ibmdbpyIda and ibmdbpyPandas                                                                                                                                                                                                                                                                                                     |
|                                                                                                                                                                                          |                          | With Spark                   | No data load support                                                                                                                                                                                                                                                                                                                            |
| \- [Amazon Simple Storage Services (S3)](https://dataplatform.cloud.ibm.com/docs/content/wsj/manage-data/conn-amazon-s3.html)  <br>\- [Amazon Simple Storage Services (S3) with an IAM access policy](https://dataplatform.cloud.ibm.com/docs/content/wsj/manage-data/conn-amazon-s3.html) |                          |
|                                                                                                                                                                                          | Python                   | Anaconda Python distribution | Load data into pandasStreamingBody                                                                                                                                                                                                                                                                                                              |
|                                                                                                                                                                                          |                          | With Hadoop                  | Load data into pandasStreamingBody and sparkSessionSetup                                                                                                                                                                                                                                                                                        |
|                                                                                                                                                                                          | R                        | Anaconda R distributuion     | Load data into rRawObject                                                                                                                                                                                                                                                                                                                       |
|                                                                                                                                                                                          |                          | With Hadoop                  | Load data into rRawObject and sparkSessionSetup                                                                                                                                                                                                                                                                                                 |
| \- [IBM Cloud Databases for PostgreSQL](https://dataplatform.cloud.ibm.com/docs/content/wsj/manage-data/conn-dbase-postgresql.html)  <br>\- [Microsoft SQL Server](https://dataplatform.cloud.ibm.com/docs/content/wsj/manage-data/conn-sql-server.html)                                                                                                               |                          |
|                                                                                                                                                                                          | Python                   | Anaconda Python distribution | Load data into pandasDataFrame                                                                                                                                                                                                                                                                                                                  |
|                                                                                                                                                                                          |                          | With Spark                   | Load data into pandasDataFrame                                                                                                                                                                                                                                                                                                                  |
|                                                                                                                                                                                          | R                        | Anaconda R distribution      | Load data into R data frame                                                                                                                                                                                                                                                                                                                     |
|                                                                                                                                                                                          |                          | With Spark                   | Load data into R data frame and sparkSessionDataFrame                                                                                                                                                                                                                                                                                           |
| \- [IBM Cognos Analytics](https://dataplatform.cloud.ibm.com/docs/content/wsj/manage-data/conn-cognos.html)                                                                                                                                                              |                          |
|                                                                                                                                                                                          | Python                   | Anaconda Python distribution | Load data into pandasDataFrame  <br>  <br>In the generated code:  <br>\- Edit the path parameter in the last line of code  <br>\- Remove the comment tagging  <br>  <br>To read data, see [Reading data from a data source](https://www.ibm.com/support/knowledgecenter/en/SSEP7J_11.1.0/com.ibm.swg.ba.cognos.ca_notebook.doc/c_read_notebook.html)  <br>To search data, see [Searching for data objects](https://www.ibm.com/support/knowledgecenter/en/SSEP7J_11.1.0/com.ibm.swg.ba.cognos.ca_notebook.doc/c_search_for_data_objects_notebook.html)  <br>To write data, see [Writing data to a data source](https://www.ibm.com/support/knowledgecenter/en/SSEP7J_11.1.0/com.ibm.swg.ba.cognos.ca_notebook.doc/c_write_notebook.html) |
|                                                                                                                                                                                          |                          | With Spark                   | No data load support                                                                                                                                                                                                                                                                                                                            |
|                                                                                                                                                                                          | R                        | Anaconda R distribution      | Load data into R data frame  <br>  <br>In the generated code:  <br>\- Edit the path parameter in the last line of code  <br>\- Remove the comment tagging  <br>  <br>To read data, see [Reading data from a data source](https://www.ibm.com/support/knowledgecenter/en/SSEP7J_11.1.0/com.ibm.swg.ba.cognos.ca_notebook.doc/c_read_notebook.html)  <br>To search data, see [Searching for data objects](https://www.ibm.com/support/knowledgecenter/en/SSEP7J_11.1.0/com.ibm.swg.ba.cognos.ca_notebook.doc/c_search_for_data_objects_notebook.html)  <br>To write data, see [Writing data to a data source](https://www.ibm.com/support/knowledgecenter/en/SSEP7J_11.1.0/com.ibm.swg.ba.cognos.ca_notebook.doc/c_write_notebook.html)    |
|                                                                                                                                                                                          |                          | With Spark                   | No data load support                                                                                                                                                                                                                                                                                                                            |
| \- [Microsoft Azure Cosmos DB](https://dataplatform.cloud.ibm.com/docs/content/wsj/manage-data/conn-cosmosdb.html)                                                                                                                                                         |                          |
|                                                                                                                                                                                          | Python                   | Anaconda Python distribution | Load data into pandasDataFrame                                                                                                                                                                                                                                                                                                                  |
|                                                                                                                                                                                          |                          | With Spark                   | Load data into pandasDataFrame                                                                                                                                                                                                                                                                                                                  |
|                                                                                                                                                                                          | R                        | Anaconda R distribution      | No data load support                                                                                                                                                                                                                                                                                                                            |
|                                                                                                                                                                                          |                          | With Spark                   | No data load support                                                                                                                                                                                                                                                                                                                            |
| \- [Amazon RDS for MySQL](https://dataplatform.cloud.ibm.com/docs/content/wsj/manage-data/conn-azrds-mysql.html)  <br>                                                                                                                                                        |                          |
|                                                                                                                                                                                          | Python                   | Anaconda Python distribution | Load data into pandasDataFrame                                                                                                                                                                                                                                                                                                                  |
|                                                                                                                                                                                          |                          | With Spark                   | Load data into pandasDataFrame                                                                                                                                                                                                                                                                                                                  |
|                                                                                                                                                                                          | R                        | Anaconda R distribution      | Load data into R data frame and sparkSessionDataFrame                                                                                                                                                                                                                                                                                           |
|                                                                                                                                                                                          |                          | With Spark                   | No data load support                                                                                                                                                                                                                                                                                                                            |
| \- [HTTP](https://dataplatform.cloud.ibm.com/docs/content/wsj/manage-data/conn-http.html)  <br>\- [Apache Cassandra](https://dataplatform.cloud.ibm.com/docs/content/wsj/manage-data/conn-cassandra.html)  <br>\- [Amazon RDS for PostgreSQL](https://dataplatform.cloud.ibm.com/docs/content/wsj/manage-data/conn-azrds-postresql.html)                                                                                                           |                          |
|                                                                                                                                                                                          | Python                   | Anaconda Python distribution | Load data into pandasDataFrame                                                                                                                                                                                                                                                                                                                  |
|                                                                                                                                                                                          |                          | With Spark                   | Load data into pandasDataFrame                                                                                                                                                                                                                                                                                                                  |
|                                                                                                                                                                                          | R                        | Anaconda R distribution      | Load data into R data frame                                                                                                                                                                                                                                                                                                                     |
|                                                                                                                                                                                          |                          | With Spark                   | Load data into R data frame                                                                                                                                                                                                                                                                                                                     |

<!-- </table ""> -->

**Parent topic:**[Loading and accessing data in a notebook](https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/load-and-access-data.html)

<!-- </article "role="article" "> -->