Data360 Analyze

Welcome to the Data360 Analyze community!  Please feel free to start a discussion in the discussion tab or join in a conversation.

Here are some useful links where you can find more information:

Product Announcements  Product Documentation  Ideas Portal

Discussions

Members

Resources

Events

 View Only
  • 1.  Importing Libraries and running Python Script

    Employee
    Posted 12-11-2018 19:50

    Hi Adrian,

    I want to ask in reference to the below discussion that you had earlier with Shashi.

    https://support.infogix.com/hc/en-us/community/posts/360028941893-How-to-run-system-commands-in-DataVerse

    [Edit: ^ Updated URL]

    In the above post you mentioned that we have to install python libraries compatible with Dataverse Python 2.7 and 32-bit architecture. So lets say I have to use libraries pandas and numpy then I do need to install them first before calling them through dataverse.

    Secondly, can I just write my custom logic using the aforementioned libraries above the braininfo script and the node will execute it properly or not. I have attached a script for your reference which will give you an idea on what I am trying to accomplish.

    It will be very helpful if you could give me an example of library pandas usage inside Dataverse. Also, please tell how to dealwith 'double' data types while using them in Transform Node. I tried to use float type as it has python's float has double handling in it but Dataverse is giving unsupported operand error

    Best,

    Rakshit



  • 2.  RE: Importing Libraries and running Python Script

    Employee
    Posted 12-12-2018 09:53

    Hi Rakshit,


    No script was attached to your post.


    Yes, you need to install any Python packages before they can be imported. See the attached archive file for installation instructions and example.

     

    As you state in your post, when using the Transform node the Python float type is appropriate for representing floating point numbers.

    Are there any further details of the error message for the unsupported operand error? I assume it may relate to the presence of Null values in your data. You need to explicitly handle Null values in the Transform node's script except when using the 'Null-Safe' comparison functions in the fn module (see the Python Scripting topic in the online help for further details). A simple example of how a Null value can be handled is:

    Regards,

    Adrian

     

    Attached files

    Install_numpy_pandas_in_Data3Sixty_Analyze.zip



  • 3.  RE: Importing Libraries and running Python Script

    Employee
    Posted 12-12-2018 11:19

    Hi Adrian,

    Thank you for your response. I will definetly review the numpy installation and also check the transform node further. Please find aatached the text file containing the script that I want to execute on Python. It will be helpful if you can just tell me whether I can execute this script by just copying it to the python node without making any changes to the existing braininfo script.

    Also, do I need to uninstall Python 3.7 as it is installed in my root and pandas and numpypackages are already present. Can the same one be used with dataverse

    Best,

    Rakshit

     

    Attached files

    Python_samplecode.txt

     



  • 4.  RE: Importing Libraries and running Python Script

    Employee
    Posted 12-13-2018 04:06

    Hi Rakshit,

    Unfortunately no, you will not be able to execute the script unchanged. 

    The Python node is an older node that uses a different (and i.m.o. a more complex) interface compared with the newer Python-based nodes (Transform, etc).  You should review the Help information for the Python node in the Reference > Python node configuration topic, or in the corresponding online help documentation here:

    https://d3sa-preview.infogixsaas.com/docs/dist/help/Default.htm#h-tech-guides/python-getting-started.htm%3FTocPath%3DReference%7CPython%2520node%2520configuration%7C_____0

    [Edit: ^ Updated URL]

    which walks you through an example and explains the various statements in the Python2Implementation property's script.

    Regarding your existing installation of Python 3.7 - it depends on the options chosen when the Python distribution was installed. There may be interactions between the different distributions if it was added to your PATH environment variable. This issue is not constrained to interactions with Data3Sixty Analyze and can occur with other applications and distributions. Indeed, the Anaconda installation instructions for Windows  provides a caution about setting the PATH variable. It is highly unlikely that you would be able to use the existing packages with the embedded install of Python used by Data3Sixty Analyze.

     

    Regards,

    Adrian