python recipe output to a dataset

Tags
Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Adv Designer, Registered Posts: 4 ✭✭✭

hello i have a list containing items as data frame type i want to make an output to this output as text file or json file if any one can help me please

Welcome!

It looks like you're new here. Sign in or register to get started.

Answers

  • Dataiku DSS Core Designer, Neuron, Dataiku DSS Adv Designer, Registered, Neuron 2023 Posts: 2,405 Neuron

    It really depends what you want to do with the file after. Is this a one off export? Why do you need the output as a file? Can you explain your requirement in detail?

  • Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Adv Designer, Registered Posts: 4 ✭✭✭

    hello @Turribeach
    yes please if you can help me

    i want to have as output multiple dataframes in a managed folder if you can please help me

    regards

  • Dataiku DSS Core Designer, Neuron, Dataiku DSS Adv Designer, Registered, Neuron 2023 Posts: 2,405 Neuron
    edited July 2024

    The following Python code in a Python recipe will output the contents of the df dataframe to a CSV file:

    import dataiku
    
    path_upload_file = "output.csv"
    handle = dataiku.Folder("Some Managed Folder")
    
    with handle.get_writer(path_upload_file) as w:
        w.write(df.to_csv().encode('utf-8'))

Welcome!

It looks like you're new here. Sign in or register to get started.

Welcome!

It looks like you're new here. Sign in or register to get started.