Importing Libraries and running Python Script

Comments

3 comments

  • Avatar
    Adrian Williams

    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

    0
    Comment actions Permalink
  • Avatar
    rakshit bhargava

    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

     

    0
    Comment actions Permalink
  • Avatar
    Adrian Williams

    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

     

    0
    Comment actions Permalink

Please sign in to leave a comment.



Powered by Zendesk