How to load multiple dataset via "execute python" operator?

tahsin
tahsin New Altair Community Member
edited November 5 in Community Q&A
Hello,

I am working with the execute python operator. I know how the overall structure works and was successful running it but when I work with multiple datasets I am a bit confused how it works. How do I declare the datasets after I connect the input ports? 

Thanks. 
Tagged:

Best Answer

  • kayman
    kayman New Altair Community Member
    Answer ✓
    Your datasets are 'assigned' to your inputs, so if you have one input you would use 

    def rm_main(my_dataset_1):

    If you have 2 it would become :

    def rm_main(my_dataset_1, my_dataset_2):

    And so on.

    To get multiple outputs it works like this :

    return my_dataframe_1

    will provide a datatable at the first output port

    return my_dataframe_1, my_dataframe_2

    Will return my_dataframe_1 to output 1 and my_dataframe_2 to output 2.

    And so on. And of course you can name them different...

Answers

  • kayman
    kayman New Altair Community Member
    Answer ✓
    Your datasets are 'assigned' to your inputs, so if you have one input you would use 

    def rm_main(my_dataset_1):

    If you have 2 it would become :

    def rm_main(my_dataset_1, my_dataset_2):

    And so on.

    To get multiple outputs it works like this :

    return my_dataframe_1

    will provide a datatable at the first output port

    return my_dataframe_1, my_dataframe_2

    Will return my_dataframe_1 to output 1 and my_dataframe_2 to output 2.

    And so on. And of course you can name them different...