Reading Data from another project in jupiter notebooks

SharonNasimiyu
SharonNasimiyu Registered Posts: 1

Hello I want to read data from another project how do i go about it

Answers

  • Catalina
    Catalina Dataiker, Dataiku DSS Core Designer, Registered Posts: 135 Dataiker
    edited July 17

    Hi @SharonNasimiyu
    ,

    To read the data from another project you can use below code in a Jupiter notebook:

    import dataiku
    
    project_key="TEST_PROJECT"
    dataset_name="input"
    
    client = dataiku.api_client()
    project = client.get_project(project_key)
       
    dataset_input = project.get_dataset(dataset_name).get_as_core_dataset()
    df = dataset_input.get_dataframe()  #pandas data frame object

  • Ioannis
    Ioannis Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Adv Designer, Registered Posts: 28 ✭✭✭✭✭
    edited July 17

    Another way to read the dataset is this:

    import pandas as pd

    path = '/app/dataiku/DSS_DATA_DIR/managed_datasets/REPLACE_WITH_PROJECT/REPLACE_WITH_DATASET/'
    df = pd.read_csv(path+'out-s0.csv.gz', compression='gzip', header=0, sep='\t', quotechar='"')

Setup Info
    Tags
      Help me…